multiViewBean.setName("Foo");
multiViewBean.setAge(16);
multiViewBean.setOtherValue("others");
// public view
ObjectWriter publicWriter = mapper.getMapper().writerWithView(Views.Public.class);
assertThat(publicWriter.writeValueAsString(multiViewBean)).isEqualTo(
"{\"name\":\"Foo\",\"otherValue\":\"others\"}");
// internal view
ObjectWriter internalWriter = mapper.getMapper().writerWithView(Views.Internal.class);
assertThat(internalWriter.writeValueAsString(multiViewBean))
.isEqualTo("{\"age\":16,\"otherValue\":\"others\"}");
}