### Question:
SpringReference extends AbstractSpringReference<T> implements IClusterable { public static <T> SpringReference<T> of(Class<T> clazz) { return of(clazz, null); } SpringReference(Class<T> clazz, String name); static SpringReference<T> of(Class<T> clazz); static SpringReference<T> of(Class<T> clazz, String name); @Override SpringReference<T> clone();  }### Answer:
@Test public void classOnlyTest() { SpringReference<ClassService> reference = SpringReference.of(ClassService.class); testReference(reference, 1); }
@Test public void nameAndClassTest() { SpringReference<PrimaryService> reference = SpringReference.of(PrimaryService.class, "named"); testReference(reference, 2); }
@Test public void primaryTest() { SpringReference<PrimaryService> reference = SpringReference.of(PrimaryService.class); testReference(reference, 3); }
@Test public void autowireTest() { SpringReference<AutowireService> reference = SpringReference.of(AutowireService.class); testReference(reference, 6); }
@Test public void constructorTest() { SpringReference<ConstructorService> reference = SpringReference.of(ConstructorService.class); testReference(reference, 4); }
@Test public void subClass1Test() { SpringReference<AService> reference = SpringReference.of(AService.class, "named"); testReference(reference, 2); }
@Test public void subClass2Test() { SpringReference<AService> reference = SpringReference.of(AService.class); testReference(reference, 3); }
@Test public void lazyTest() { SpringReference<AService> reference = SpringReference.of(AService.class, "not-existing-bean-id"); try { testReference(reference, -1); throw new IllegalStateException("Not exsisting spring bean found."); } catch (NoSuchBeanDefinitionException e) { } }