FactorSet implements FactorGroup { @Override public List<Factor> without(Collection<Factor> factors) { ArrayList<Factor> allFactors = Lists.newArrayList(factorsByType.values()); allFactors.removeAll(factors); return allFactors; } FactorSet(); private  FactorSet(Map<String, Factor> factorsByType); FactorSet add(Factor factor); @Override Iterator<Factor> iterator(); @Override Factor factorOfType(String type); @Override int compareTo(FactorGroup other); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); @Override List<Factor> without(Collection<Factor> factors); @Override FactorGroup withoutTypes(Collection<String> factorTypes); static FactorSet create(Map<String, String> factorValueByType); int size(); @Override boolean isEmpty(); @Override boolean containsOnlyOrganism(); final Map<String, Factor> factorsByType; }
@Test public void testRemove() { List<Factor> afterRemoval = Lists.newArrayList(factorThree); assertThat(subject.without(Lists.newArrayList(factorOne, factorTwo)), is(afterRemoval)); }