### Question:
Capabilities { public static Capabilities fromIntList(List<Integer> capabilities) { return new Capabilities(capabilities.stream() .filter(integer -> integer < Capability.values().length) .filter(integer -> integer >= 0) .map(integer -> Capability.values()[integer]) .collect(Collectors.toSet())); } Capabilities(Capability... capabilities);  Capabilities(Capabilities capabilities);  Capabilities(Collection<Capability> capabilities); void set(Capability... capabilities); void set(Capabilities capabilities); void set(Collection<Capability> capabilities); void addAll(Capability... capabilities); void addAll(Capabilities capabilities); boolean containsAll(final Set<Capability> requiredItems); boolean containsAll(final Capabilities capabilities); boolean containsAll(Capability... capabilities); boolean isEmpty(); static List<Integer> toIntList(Capabilities capabilities); static Capabilities fromIntList(List<Integer> capabilities); static Capabilities fromStringList(String list); String toStringList(); static boolean hasMandatoryCapability(Capabilities capabilities); static boolean hasMandatoryCapability(Capabilities capabilities, Capability mandatoryCapability); @Override String toString(); String prettyPrint(); int size(); static final Capabilities app; }### Answer:
@Test public void testFromIntList() { assertEquals(new Capabilities(), Capabilities.fromIntList(Collections.emptyList())); assertEquals(new Capabilities(Capability.MEDIATION), Capabilities.fromIntList(Collections.singletonList(12))); assertEquals(new Capabilities(Capability.BLIND_VOTE, Capability.MEDIATION), Capabilities.fromIntList(Arrays.asList(6, 12))); assertEquals(new Capabilities(), Capabilities.fromIntList(Collections.singletonList(-1))); assertEquals(new Capabilities(), Capabilities.fromIntList(Collections.singletonList(99))); assertEquals(new Capabilities(Capability.MEDIATION), Capabilities.fromIntList(Arrays.asList(-6, 12))); assertEquals(new Capabilities(Capability.MEDIATION), Capabilities.fromIntList(Arrays.asList(12, 99))); }