protected <T, K> T applyManyTraits( K core, Collection<Class<? extends Thing>> traits, Object value, boolean logical) throws LogicalTypeInconsistencyException {
// Precondition : traits is not empty, checked by don
TraitFactory builder = TraitFactory.getTraitBuilderForKnowledgeBase( this.getKnowledgeRuntime().getKnowledgeBase() );
TraitableBean inner = makeTraitable( core, builder, logical );
Collection<Key<Thing>> mostSpecificTraits = inner.getMostSpecificTraits();
boolean newTraitsAdded = false;
T firstThing = null;
Map<Thing, BitSet> things = new HashMap<Thing, BitSet>( traits.size() );
for ( Class<?> trait : traits ) {
boolean needsProxy = trait.isAssignableFrom( inner.getClass() );
boolean hasTrait = inner.hasTrait( trait.getName() );
boolean needsUpdate = needsProxy || core != inner;
if ( ! hasTrait ) {
BitSet boundary = inner.getCurrentTypeCode() != null ? (BitSet) inner.getCurrentTypeCode().clone() : null;
T thing = (T) asTrait( core, inner, trait, needsProxy, hasTrait, needsUpdate, builder, logical );
configureTrait( thing, value );