ContainerUtils { public static <T> Class<T> findImplClass(final Class<?> notSureType) { Class<?> tmpType = notSureType; ImplBy implBy = null; do { implBy = tmpType.getAnnotation(ImplBy.class); if (implBy != null) { tmpType = implBy.value(); } if (tmpType == notSureType) { break; } } while (implBy != null); return (Class<T>) tmpType; }  static Method findInitMethod(Class<?> targetBeanType, BindInfo<?> bindInfo); static Method findDestroyMethod(Class<?> targetBeanType, BindInfo<?> bindInfo); static Class<T> findImplClass(final Class<?> notSureType); static Annotation findInject(boolean injectDefault, Annotation[] annotations); static boolean isInjectConstructor(Constructor<?> constructor); static Object injSettings(AppContext appContext, InjectSettings injectSettings, Class<?> toType); static void invokeMethod(Object targetBean, Method initMethod); static void invokeField(Field field, Object targetBean, Object newValue); static boolean testAopIgnore(Class<T> targetType, ClassLoader rootLoader);  }
@Test public void test1() { assert ContainerUtils.findImplClass(ImplSampleBean.class).equals(ImplSampleBean.class); assert ContainerUtils.findImplClass(SampleBeanFace.class).equals(ImplSampleBean.class); assert ContainerUtils.findImplClass(SampleBeanFaceByFace.class).equals(ImplSampleBean.class); }