@Test public void testGetCachedVersions() { OncotreeTestConfig config = new OncotreeTestConfig(); List<Version> returnedCachedVersions = cacheUtil.getCachedVersions(); String expectedVersionNames = ""; String returnedVersionNames = ""; if (!versionListsAreEqual(oncoTreeVersionRepositoryMockResponse, returnedCachedVersions)) { expectedVersionNames = getVersionListNames(oncoTreeVersionRepositoryMockResponse); returnedVersionNames = getVersionListNames(returnedCachedVersions); fail("Expected and returned cached versions differ. Expected: " + expectedVersionNames + ", Returned: " + returnedVersionNames); } config.resetAdditionalVersionRepository(oncoTreeVersionRepository); cacheUtil.resetCache(); returnedCachedVersions = cacheUtil.getCachedVersions(); if (!versionListsAreEqual(oncoTreeAdditionalVersionRepositoryMockResponse, returnedCachedVersions)) { expectedVersionNames = getVersionListNames(oncoTreeVersionRepositoryMockResponse); returnedVersionNames = getVersionListNames(returnedCachedVersions); fail("Expected and returned cached versions differ. Expected: " + expectedVersionNames + ", Returned: " + returnedVersionNames); } }
public List<Version> getCachedVersions() { if (tumorTypesCache == null) { resetCache(); } List<Version> cachedVersions = new ArrayList<>(tumorTypesCache.keySet()); return cachedVersions; }
CacheUtil { public List<Version> getCachedVersions() { if (tumorTypesCache == null) { resetCache(); } List<Version> cachedVersions = new ArrayList<>(tumorTypesCache.keySet()); return cachedVersions; } }
CacheUtil { public List<Version> getCachedVersions() { if (tumorTypesCache == null) { resetCache(); } List<Version> cachedVersions = new ArrayList<>(tumorTypesCache.keySet()); return cachedVersions; }  }
CacheUtil { public List<Version> getCachedVersions() { if (tumorTypesCache == null) { resetCache(); } List<Version> cachedVersions = new ArrayList<>(tumorTypesCache.keySet()); return cachedVersions; }  void resetCache(); Date getDateOfLastCacheRefresh(); void setDateOfLastCacheRefresh(Date date); List<Version> getCachedVersions(); Map<String, TumorType> getTumorTypesByVersion(Version version); boolean cacheIsStale(); }
CacheUtil { public List<Version> getCachedVersions() { if (tumorTypesCache == null) { resetCache(); } List<Version> cachedVersions = new ArrayList<>(tumorTypesCache.keySet()); return cachedVersions; }  void resetCache(); Date getDateOfLastCacheRefresh(); void setDateOfLastCacheRefresh(Date date); List<Version> getCachedVersions(); Map<String, TumorType> getTumorTypesByVersion(Version version); boolean cacheIsStale(); static final Integer MAXIMUM_CACHE_AGE_IN_DAYS; }