### Question:
GroupsCache extends AbstractGroupCache { public GroupCacheEntry getCacheEntry(DocumentReference reference, Collection<String> wikis, boolean create) { String key = toKey(reference, wikis); return getCacheEntry(key, reference, create); } GroupsCache(); GroupCacheEntry getCacheEntry(DocumentReference reference, Collection<String> wikis, boolean create);  }### Answer:
@Test public void getCacheEntry() { GroupCacheEntry entry = getCacheEntry(true); List<DocumentReference> all = Arrays.asList(GROUP1, GROUP2); List<DocumentReference> direct = Arrays.asList(GROUP1); entry.setAll(all); entry = getCacheEntry(true); assertEquals(all, new ArrayList<>(entry.getAll())); entry.setDirect(direct); entry = getCacheEntry(true); assertEquals(direct, new ArrayList<>(entry.getDirect())); }
@Test public void cleanCacheReference() { fillCache(); assertNotNull(getCacheEntry(false)); this.groupsCache.cleanCache(USER); assertNull(getCacheEntry(false)); fillCache(); assertNotNull(getCacheEntry(false)); this.groupsCache.cleanCache(GROUP1); assertNull(getCacheEntry(false)); fillCache(); assertNotNull(getCacheEntry(false)); this.groupsCache.cleanCache(GROUP2); assertNull(getCacheEntry(false)); }
@Test public void cleanCacheWiki() { fillCache(); assertNotNull(getCacheEntry(false)); this.groupsCache.cleanCache(USER.getWikiReference().getName()); assertNull(getCacheEntry(false)); fillCache(); assertNotNull(getCacheEntry(false)); this.groupsCache.cleanCache(GROUP1.getWikiReference().getName()); assertNull(getCacheEntry(false)); fillCache(); assertNotNull(getCacheEntry(false)); this.groupsCache.cleanCache(GROUP2.getWikiReference().getName()); assertNull(getCacheEntry(false)); fillCache(); assertNotNull(getCacheEntry(false)); this.groupsCache.cleanCache("otherwiki"); assertNotNull(getCacheEntry(false)); }