### Question:
Capabilities { public static Capabilities fromStringList(String list) { if (list == null || list.isEmpty()) return new Capabilities(); List<String> entries = List.of(list.replace(" ", "").split(",")); List<Integer> capabilitiesList = entries.stream() .map(c -> { try { return Integer.parseInt(c); } catch (Throwable e) { return null; } }) .filter(Objects::nonNull) .collect(Collectors.toList()); return Capabilities.fromIntList(capabilitiesList); } 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 testFromStringList() { assertEquals(new Capabilities(), Capabilities.fromStringList(null)); assertEquals(new Capabilities(), Capabilities.fromStringList("")); assertEquals(new Capabilities(Capability.MEDIATION), Capabilities.fromStringList("12")); assertEquals(new Capabilities(Capability.BLIND_VOTE, Capability.MEDIATION), Capabilities.fromStringList("6,12")); assertEquals(new Capabilities(Capability.BLIND_VOTE, Capability.MEDIATION), Capabilities.fromStringList("12, 6")); assertEquals(new Capabilities(), Capabilities.fromStringList("a")); assertEquals(new Capabilities(), Capabilities.fromStringList("99")); assertEquals(new Capabilities(), Capabilities.fromStringList("-1")); assertEquals(new Capabilities(Capability.MEDIATION), Capabilities.fromStringList("12, a")); assertEquals(new Capabilities(Capability.MEDIATION), Capabilities.fromStringList("12, 99")); assertEquals(new Capabilities(Capability.MEDIATION), Capabilities.fromStringList("a,12, 99")); }