@Test public void toProperties_null() { final Person object = new Person(); final Map<String, Object> stringObjectMap = mapper.toProperties(object); Map<String, Object> properties = new HashMap<>(); properties.put("address", null); properties.put("type", "person"); ASSERT.that(properties).isEqualTo(stringObjectMap); }
@Override public Map<String, Object> toProperties(Person object) { final Map<String, Object> properties = new HashMap<>(); properties.put("type", "person"); properties.put("address", object.address == null ? null : addressMapper.toProperties(object.address)); return properties; }
Person implements Mapper<Person> { @Override public Map<String, Object> toProperties(Person object) { final Map<String, Object> properties = new HashMap<>(); properties.put("type", "person"); properties.put("address", object.address == null ? null : addressMapper.toProperties(object.address)); return properties; } }
Person implements Mapper<Person> { @Override public Map<String, Object> toProperties(Person object) { final Map<String, Object> properties = new HashMap<>(); properties.put("type", "person"); properties.put("address", object.address == null ? null : addressMapper.toProperties(object.address)); return properties; }  }
Person implements Mapper<Person> { @Override public Map<String, Object> toProperties(Person object) { final Map<String, Object> properties = new HashMap<>(); properties.put("type", "person"); properties.put("address", object.address == null ? null : addressMapper.toProperties(object.address)); return properties; }  @Override Person toObject(Map<String, Object> properties); @Override Map<String, Object> toProperties(Person object); }
Person implements Mapper<Person> { @Override public Map<String, Object> toProperties(Person object) { final Map<String, Object> properties = new HashMap<>(); properties.put("type", "person"); properties.put("address", object.address == null ? null : addressMapper.toProperties(object.address)); return properties; }  @Override Person toObject(Map<String, Object> properties); @Override Map<String, Object> toProperties(Person object); public Address addressMapper; }