@Test public void testGetGroups_mutableResponse() { Repository repo = mockRepository("repo"); Repository group = mockGroupRepository("group", repo); when(repositoryManager.browse()).thenReturn(Arrays.asList(repo, group)); List<String> groups = underTest.getGroups("repo"); assertThat(groups, contains("group")); groups.add("fakevalue"); groups = underTest.getGroups("repo"); assertThat(groups, contains("group")); }
List<String> getGroups(String member) { return new ArrayList<>(getCache().getOrDefault(member, Collections.emptyList())); }
GroupMemberMappingCache extends ComponentSupport implements EventAware { List<String> getGroups(String member) { return new ArrayList<>(getCache().getOrDefault(member, Collections.emptyList())); } }
GroupMemberMappingCache extends ComponentSupport implements EventAware { List<String> getGroups(String member) { return new ArrayList<>(getCache().getOrDefault(member, Collections.emptyList())); }  }
GroupMemberMappingCache extends ComponentSupport implements EventAware { List<String> getGroups(String member) { return new ArrayList<>(getCache().getOrDefault(member, Collections.emptyList())); }  @Subscribe void on(final RepositoryCreatedEvent event); @Subscribe void on(final RepositoryUpdatedEvent event); @Subscribe void on(final RepositoryDeletedEvent event); }
GroupMemberMappingCache extends ComponentSupport implements EventAware { List<String> getGroups(String member) { return new ArrayList<>(getCache().getOrDefault(member, Collections.emptyList())); }  @Subscribe void on(final RepositoryCreatedEvent event); @Subscribe void on(final RepositoryUpdatedEvent event); @Subscribe void on(final RepositoryDeletedEvent event);  }