for ( Object o : ks.getObjects( new ClassObjectFilter( ks.getKieBase().getFactType( "org.drools.test", "Y" ).getFactClass() ) ) ) {
assertTrue( o instanceof TraitableBean );
TraitableBean tb = (TraitableBean) o;
TraitField fld = tb._getFieldTMS().getRegisteredTraitField( "fld" );
Set<Class<?>> types = fld.getRangeTypes();
assertEquals( 2, types.size() );
TraitField fld2 = tb._getFieldTMS().getRegisteredTraitField( "fld2" );
Set<Class<?>> types2 = fld2.getRangeTypes();
assertEquals( 1, types2.size() );
}
try {
ks = SerializationHelper.getSerialisedStatefulKnowledgeSession( ks, true );