### Question:
ToCalendarAttendeeModelTransformer implements BiFunction<Map<String, Object>, TransformerContext, CalendarAttendeeModel> { @Override @SuppressWarnings("unchecked") public CalendarAttendeeModel apply(Map<String, Object> attendee, TransformerContext context) { if (attendee == null) { return null; } boolean optional = !attendee.getOrDefault("type", "false").equals("required"); Map<String, ?> emailAddress = (Map<String, ?>) attendee.get("emailAddress"); String displayName = TransformerHelper.getString("name", emailAddress).orElse(""); String email = TransformerHelper.getString("address", emailAddress).orElse(""); return new CalendarAttendeeModel(displayName, email, optional); }  @Override @SuppressWarnings("unchecked") CalendarAttendeeModel apply(Map<String, Object> attendee, TransformerContext context);  }### Answer:
@Test public void testTransform() { Map<String, Object> attendeeMap = new HashMap<>(); attendeeMap.put("type", "required"); Map<String, String> addressMap = new HashMap<>(); addressMap.put("name", "Test Test1"); addressMap.put("address", "foo@foo.com"); attendeeMap.put("emailAddress", addressMap); CalendarAttendeeModel attendee = transformer.apply(attendeeMap, new TestTransformerContext()); Assert.assertFalse(attendee.getOptional()); Assert.assertEquals("Test Test1", attendee.getDisplayName()); Assert.assertEquals("foo@foo.com", attendee.getEmail()); }