### Question:
ObjectNameCache { public String getPlaceName(Address place) { try { return names.get(place, () -> loadPlace(place)); } catch (ExecutionException|UncheckedExecutionException e) { logger.warn("Unable to determine place name", e); return UNKNOWN_PLACE_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 testGetPlaceName() { expectFindPlace(); replay(); assertEquals(place.getName(), cache.getPlaceName(placeAddress)); assertEquals(place.getName(), cache.getPlaceName(placeAddress)); verify(); }
@Test public void testGetPlaceNameNotFound() { expectPlaceNotFound(); replay(); assertEquals("UNKNOWN_PLACE", cache.getPlaceName(placeAddress)); verify(); }