InstanceDescriptorFactory { public static <T> InstanceDescriptor<T> createAllLoaded(T instance, EntityType<T> et) { final InstanceDescriptor<T> descriptor = createNotLoaded(instance, et); et.getFieldSpecifications().forEach(fs -> descriptor.setLoaded(fs, LoadState.LOADED)); return descriptor; } private  InstanceDescriptorFactory(); static InstanceDescriptor<T> createNotLoaded(T instance, EntityType<T> et); static InstanceDescriptor<T> createAllLoaded(T instance, EntityType<T> et); static InstanceDescriptor<T> create(T instance, EntityType<T> et); static InstanceDescriptor<T> createCopy(T instance, InstanceDescriptor<T> original);  }
@Test void createAllLoadedCreatesInstanceDescriptorWithAllAttributesInLoadedState() { final OWLClassA instance = Generators.generateOwlClassAInstance(); final InstanceDescriptor<OWLClassA> result = InstanceDescriptorFactory .createAllLoaded(instance, metamodelMocks.forOwlClassA().entityType()); assertNotNull(result); metamodelMocks.forOwlClassA().entityType().getFieldSpecifications() .forEach(fs -> assertEquals(LoadState.LOADED, result.isLoaded(fs))); }