### Question:
Groups { public Boolean any(String... groupNames) { Boolean output = false; if (this.groups != null) { for (String groupName : groupNames) { if (this.groups.stream() .map(GroupInfo::getName) .anyMatch(p -> p.equals(groupName))) { output = true; break; } } } return output; }  List<String> getGroupNames(); Boolean any(String... groupNames); GroupInfo getGroup(String groupName);  }### Answer:
@Test public void should_returnTrue_when_groupsContainsPermission() { Groups sut = this.generateSut(); assertTrue(sut.any("group.2")); }
@Test public void should_returnFalse_when_groupsDoesNotContainsPermission() { Groups sut = this.generateSut(); assertFalse(sut.any("group.4")); }
@Test public void should_returnFalse_when_groupsContainsPermissionInDifferentCase() { Groups sut = this.generateSut(); assertFalse(sut.any("GrouP.2")); }
@Test public void should_returnTrue_when_groupsContainsOnePermission() { Groups sut = this.generateSut(); assertTrue(sut.any("GrouP.4", "group.1")); }
@Test public void should_returnFalse_when_groupsContainsNull() { Groups sut = this.generateSut(); sut.setGroups(null); assertFalse(sut.any("group.1")); }