@Test
public void testAsJsonStringWithView() {

  final Foo f = new Foo();
  // All properties
  final String json_all = JacksonUtil.asJsonString(f, null, null);
  assertEquals("{\"bar\":\"bar\",\"test\":\"test\"}", json_all);
  // Only bar property
  final String json_bar = JacksonUtil.asJsonString(f, null, TestViews.DefaultView.class);
  assertEquals("{\"bar\":\"bar\"}", json_bar);
  // All properties
  final String json_test = JacksonUtil.asJsonString(f, null, TestViews.TestView.class);
  assertEquals("{\"bar\":\"bar\",\"test\":\"test\"}", json_all);
}