ReflectionUtils { @Api(2.0) @NonNull public static <T, D> Constructor<T> getConstructor(@NonNull Class<T> constructedClass, @NonNull Class<D> innerConstructorClass) { try { return constructedClass.getConstructor(innerConstructorClass); } catch (NoSuchMethodException e) { throw new HaloReflectionException("The constructor for " + constructedClass.getCanonicalName() + " and first parameter of class " + innerConstructorClass.getCanonicalName() + " does not exist.", e); } } private  ReflectionUtils(); @Api(2.0) @Nullable static Class<?> toClass(@Nullable String name); @Api(2.0) @Nullable static T newInstance(@NonNull Class<T> clazz); @Api(2.0) @NonNull static Constructor<T> getConstructor(@NonNull Class<T> constructedClass, @NonNull Class<D> innerConstructorClass); @Api(2.0) @NonNull static T build(@NonNull Constructor<T> constructor, @Nullable Object... data); @Api(2.0) @NonNull static String classNameToInnerFilter(@NonNull String className); @Api(2.0) @NonNull static Field[] getFields(@NonNull Class clazz, boolean bringParents); @Api(2.0) @NonNull static T valueOf(Field field, Object reference, Class<T> clazz);  }
@Test public void getConstructor() { Assert.assertNotNull(ReflectionUtils.getConstructor(PublicConstructorParam.class, PublicConstructorNoParam.class)); }
@Test(expected = HaloReflectionException.class) public void getConstructorExceptionTest() { Assert.assertNotNull(ReflectionUtils.getConstructor(PrivateConstructor.class, PublicConstructorNoParam.class)); }