mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, true);
String json = mapper.writeValueAsString(new EmptyBean());
assertEquals("{\"@type\":\"TestSubtypes$EmptyBean\"}", json);
mapper = new ObjectMapper();
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
json = mapper.writeValueAsString(new EmptyBean());
assertEquals("{\"@type\":\"TestSubtypes$EmptyBean\"}", json);
// and then with defaults
mapper = new ObjectMapper();