### Question:
WroModelInspector { public Collection<String> getGroupNamesContainingResource(final String resourceUri) { Validate.notNull(resourceUri); final Set<String> groupNames = new TreeSet<String>(); for (final Group group : map.values()) { if (group.hasResource(resourceUri)) { groupNames.add(group.getName()); } } return groupNames; } WroModelInspector(final WroModel model); Group getGroupByName(final String name); Collection<String> getGroupNamesContainingResource(final String resourceUri); final List<String> getGroupNames(); boolean hasGroup(final String groupName); String getGroupNamesAsString(); Collection<Resource> getAllUniqueResources(); Collection<Resource> getAllResources();  }### Answer:
@Test public void shouldReturnEmptyCollectionWhenAResourceIsNotContainedInAnyGroup() { assertTrue(victim.getGroupNamesContainingResource("/resourceMissingFromModel.js").isEmpty()); }
@Test public void shouldFindTheGroupContainingResource() { final Collection<String> groups = victim.getGroupNamesContainingResource("/path/to/resource"); assertEquals(2, groups.size()); assertEquals("[g2, g3]", Arrays.toString(groups.toArray())); }
@Test(expected = NullPointerException.class) public void cannotGetGroupsUsingNullResource() { victim.getGroupNamesContainingResource(null); }