### Question:
ObjectNameCache { public String getPersonName(Address personAddress) { try { return names.get(personAddress, () -> loadPerson(personAddress)); } catch (ExecutionException|UncheckedExecutionException e) { logger.warn("Unable to determine person name", e); return UNKNOWN_PERSON_NAME; } } @Inject  ObjectNameCache(
         PlaceDAO placeDao,
         DeviceDAO deviceDao,
         HubDAO hubDao,
         PersonDAO personDao,
         RuleDao ruleDao,
         HistoryAppenderConfig config,
         SceneDao sceneDao
   ); void update(PlatformMessage message); String getPlaceName(Address place); String getDeviceName(Address deviceAddress); String getHubName(Address hubAddress); String getPersonName(Address personAddress); String getRuleName(Address ruleAddress); String getSceneName(Address sceneAddress); String getName(Address address); static final String UNKNOWN_PLACE_NAME; static final String UNKNOWN_DEVICE_NAME; static final String UNKNOWN_HUB_NAME; static final String UNKNOWN_PERSON_NAME; static final String UNKNOWN_RULE_NAME; static final String UNKNOWN_SCENE_NAME; }### Answer:
@Test public void testGetPersonName() { expectFindPerson(); replay(); assertEquals(person.getFirstName(), cache.getPersonName(personAddress)); assertEquals(person.getFirstName(), cache.getPersonName(personAddress)); verify(); }
@Test public void testGetPersonNameNotFound() { expectPersonNotFound(); replay(); assertEquals("Someone", cache.getPersonName(personAddress)); verify(); }