class AttributeFactory {

    public static Collection<Class<?>> getKeepers(Iterable<Class<?>> finders) {
        Collection<Class<?>> keepers = Sets.newHashSet(finders);
        List<Class<?>> losers = AttributeFactory.mostGeneralTypes;
        if (keepers.size() == 1) {
            // do not remove anything
            return keepers;
        }
        
        // created and populated only for trace debug
        Collection<Class<?>> weepers = null;
        if (log.isTraceEnabled()) {
            weepers = Sets.newHashSet();
        }
        for (Class<?> loser : losers) {
            // try one at a time until only one remains
            // the list of losers is in priority order, lowest at the beginning
            boolean removed = keepers.remove(loser);
            if (log.isTraceEnabled() && removed) {
                weepers.add(loser);
            }
            if (keepers.size() == 1) {
                // have to stop so i don't risk removing _everything_ from keepers
                break;
            }
        }
        if (log.isTraceEnabled()) {
            log.trace("finders: " + finders);
            log.trace("keepers: " + keepers);
            log.trace("losers: " + losers);
            log.trace("weepers: " + weepers);
        }
        return keepers;
    }

    public  AttributeFactory(TypeMetadata typeMetadata);
    public  AttributeFactory(TypeMetadata typeMetadata, String defaultType);

}