### Question:
SessionMonitoringStore { public void storeSetPropertyTime(final long duration, final SessionMonitorType type) { executorService.submit(new Runnable() { @Override public void run() { if (!propertyStore.containsKey(type)) { propertyStore.putIfAbsent(type, sessionMonitoringTimingStoreFactory.createSessionMonitoringTimingStore()); } propertyStore.get(type).addTimingEntry(duration); } }); } @Inject  SessionMonitoringStore(@Named(EXECUTOR_BINDING_NAME) ExecutorService executorService,
                                  SessionMonitoringTimingStoreFactory sessionMonitoringTimingStoreFactory);   SessionMonitoringStore(ExecutorService executorService,
                                  SessionMonitoringTimingStoreFactory sessionMonitoringTimingStoreFactory,
                                  ConcurrentHashMap<SessionMonitorType, SessionMonitoringTimingStore> refreshStore,
                                  ConcurrentHashMap<SessionMonitorType, SessionMonitoringTimingStore> propertyStore,
                                  ConcurrentHashMap<SessionMonitorType, SessionMonitoringTimingStore> destroyStore,
                                  ConcurrentHashMap<SessionMonitorType, SessionMonitoringTimingStore> logoutStore); void storeRefreshTime(final long duration, final SessionMonitorType type); long getAverageRefreshTime(SessionMonitorType type); void storeSetPropertyTime(final long duration, final SessionMonitorType type); long getAverageSetPropertyTime(SessionMonitorType type); void storeDestroyTime(final long duration, final SessionMonitorType type); long getAverageDestroyTime(SessionMonitorType type); void storeLogoutTime(final long duration, final SessionMonitorType type); long getAverageLogoutTime(SessionMonitorType type); static final String EXECUTOR_BINDING_NAME; }### Answer:
@Test public void testStorePropertyTimeCreatesEntryIfNoneExists() { long duration = 0L; SessionMonitorType type = SessionMonitorType.LOCAL; SessionMonitoringTimingStore timingStore = mock(SessionMonitoringTimingStore.class); given(propertyStore.containsKey(type)).willReturn(false); given(propertyStore.get(type)).willReturn(timingStore); testSessionMonitoringStore.storeSetPropertyTime(duration, type); verify(mockFactory, times(1)).createSessionMonitoringTimingStore(); verify(timingStore, times(1)).addTimingEntry(anyLong()); }
@Test public void testStorePropertyTimeCreatesEntry() { long duration = 0L; SessionMonitorType type = SessionMonitorType.LOCAL; SessionMonitoringTimingStore timingStore = mock(SessionMonitoringTimingStore.class); given(propertyStore.containsKey(type)).willReturn(true); given(propertyStore.get(type)).willReturn(timingStore); testSessionMonitoringStore.storeSetPropertyTime(duration, type); verify(timingStore, times(1)).addTimingEntry(anyLong()); }