### Question:
AttributeFactory { public static Collection<Class<?>> getKeepers(Iterable<Class<?>> finders) { Collection<Class<?>> keepers = Sets.newHashSet(finders); List<Class<?>> losers = AttributeFactory.mostGeneralTypes; if (keepers.size() == 1) { return keepers; } Collection<Class<?>> weepers = null; if (log.isTraceEnabled()) { weepers = Sets.newHashSet(); } for (Class<?> loser : losers) { boolean removed = keepers.remove(loser); if (log.isTraceEnabled() && removed) { weepers.add(loser); } if (keepers.size() == 1) { break; } } if (log.isTraceEnabled()) { log.trace("finders: " + finders); log.trace("keepers: " + keepers); log.trace("losers: " + losers); log.trace("weepers: " + weepers); } return keepers; } AttributeFactory(TypeMetadata typeMetadata);  AttributeFactory(TypeMetadata typeMetadata, String defaultType); Attribute<?> create(String fieldName, String data, Key key, boolean toKeep); Attribute<?> create(String fieldName, String data, Key key, boolean toKeep, boolean isComposite); Attribute<?> create(String fieldName, String data, Key key, String ingestType, boolean toKeep); Attribute<?> create(String fieldName, String data, Key key, String ingestType, boolean toKeep, boolean isComposite); static Collection<Class<?>> getKeepers(Iterable<Class<?>> finders);  }### Answer:
@Test public void testFindersKeepers() { log.debug(AttributeFactory.getKeepers(one)); log.debug(AttributeFactory.getKeepers(two)); log.debug(AttributeFactory.getKeepers(three)); log.debug(AttributeFactory.getKeepers(four)); log.debug(AttributeFactory.getKeepers(five)); Assert.assertEquals(AttributeFactory.getKeepers(one), expectedOne); Assert.assertEquals(AttributeFactory.getKeepers(two), expectedTwo); Assert.assertEquals(AttributeFactory.getKeepers(three), expectedThree); Assert.assertEquals(AttributeFactory.getKeepers(four), expectedFour); Assert.assertEquals(AttributeFactory.getKeepers(five), expectedFive); }