InstanceDescriptorFactory { public static <T> InstanceDescriptor<T> createCopy(T instance, InstanceDescriptor<T> original) { return new InstanceDescriptor<>(instance, original); } 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 createCopyCopiesStateFromSpecifiedDescriptor() { final OWLClassA instance = Generators.generateOwlClassAInstance(); final InstanceDescriptor<OWLClassA> original = new InstanceDescriptor<>(instance, metamodelMocks.forOwlClassA().entityType()); final OWLClassA otherInstance = Generators.generateOwlClassAInstance(); final InstanceDescriptor<OWLClassA> result = InstanceDescriptorFactory.createCopy(otherInstance, original); assertNotNull(result); assertSame(otherInstance, result.getInstance()); assertEquals(original.isLoaded(), result.isLoaded()); }