InMemorySCMStore extends SCMStore { @Override public boolean isResourceEvictable(String key, FileStatus file) { synchronized (initialAppsLock) { if (initialApps.size() > 0) { return false; } } long staleTime = System.currentTimeMillis() - TimeUnit.MINUTES.toMillis(this.stalenessMinutes); long accessTime = getAccessTime(key); if (accessTime == -1) { long modTime = file.getModificationTime(); long lastUse = modTime < this.startTime ? this.startTime : modTime; return lastUse < staleTime; } else { return accessTime < staleTime; } } InMemorySCMStore(); @VisibleForTesting  InMemorySCMStore(AppChecker appChecker); @Override String addResource(String key, String fileName); @Override String addResourceReference(String key,
      SharedCacheResourceReference ref); @Override Collection<SharedCacheResourceReference> getResourceReferences(String key); @Override boolean removeResourceReference(String key, SharedCacheResourceReference ref,
      boolean updateAccessTime); @Override void removeResourceReferences(String key,
      Collection<SharedCacheResourceReference> refs, boolean updateAccessTime); @Override void cleanResourceReferences(String key); @Override boolean removeResource(String key); @Override boolean isResourceEvictable(String key, FileStatus file);  }
@Test public void testEvictableWithInitialApps() throws Exception { startStoreWithApps(); assertFalse(store.isResourceEvictable("key", mock(FileStatus.class))); }