### Question:
ReflectionObjectFactory implements ObjectFactory { @Override public <T> Collection<T> instantiateOrdered(Class<? extends Annotation> annotation, Object... parameter) throws InitializationException { Set<Class<?>> pluginClasses = finder.getTypesAnnotatedWith(annotation); List<Class<?>> sortedClasses = sort(pluginClasses); return Collections2.transform(sortedClasses, new Instantiate<>(parameter)); } ReflectionObjectFactory(AnnotationFinder finder, InterfaceFinder interfaceFinder); @Override Collection<T> instantiateOrdered(Class<? extends Annotation> annotation,
                                              Object... parameter); @Override Collection<T> instantiateAll(Class<? extends Annotation> annotation,
                                          Object... parameter); @Override Collection<T> instantiateAllImplementers(Class<T> interfaceClass, Object... parameter);  }### Answer:
@Test public void ordersInstancesByWeight() { annotatedClasses.add(AnnotatedDummy.class); annotatedClasses.add(AnotherAnnotatedDummy.class); Collection<AnnotatedDummy> result = factory.instantiateOrdered(DummyAnnotation.class); assertThat(Iterables.get(result, 0), is((Matcher) instanceOf(AnotherAnnotatedDummy.class))); assertThat(Iterables.get(result, 1), is((Matcher) instanceOf(AnnotatedDummy.class))); }