MyFetchResult (String url) { synchronized (myFetchCacheLock) { final MyFetchCacheEntry entry = myFetchCache.get(url); final long currentTime = System.currentTimeMillis(); if (entry != null && currentTime - entry.time() < FETCH_CACHE_TIMEOUT) { return entry.fetchResult(); } final MyFetchResult fetchResult = doCheckUrl(url); myFetchCache.put(url, new MyFetchCacheEntry(currentTime, fetchResult)); return fetchResult; } }