PersonRepresentation { public Person toPerson() { return createPerson(getEmail(), getName()); }  @JsonCreator static PersonRepresentation createPersonRepresentation(String email, String name); Person toPerson();  }
@Test public void testJsonDecode() { PersonRepresentation personRepresentation = assertValidates(decodeJson(codec, jsonStructure)); assertThat(personRepresentation.toPerson()).isEqualTo(createPerson("foo@example.com", "Mr Foo")); }