### Question:
UtilReflection { public static <T> T create(Class<T> type, Class<?>[] paramTypes, Object... params) throws NoSuchMethodException { Check.notNull(type); Check.notNull(paramTypes); Check.notNull(params); final Constructor<T> constructor = getCompatibleConstructor(type, paramTypes); return create(type, constructor, params); } private  UtilReflection(); static T create(Class<T> type, Class<?>[] paramTypes, Object... params); @SuppressWarnings("unchecked") static T createReduce(Class<T> type, Object... params); static Class<?>[] getParamTypes(Object... arguments); @SuppressWarnings("unchecked") static Constructor<T> getCompatibleConstructor(Class<T> type, Class<?>... paramTypes); @SuppressWarnings("unchecked") static Constructor<T> getCompatibleConstructorParent(Class<T> type, Class<?>[] paramTypes); static T getMethod(Object object, String name, Object... params); static T getField(Object object, String name); static void setAccessible(AccessibleObject object, boolean accessible); static Collection<Class<?>> getInterfaces(Class<?> object, Class<?> base);  }### Answer:
@Test void testCreate() throws NoSuchMethodException { assertEquals("1", UtilReflection.create(String.class, UtilReflection.getParamTypes(String.class), "1")); }
@Test void testCreateConstructorNotAccessible() { assertThrows(() -> UtilReflection.create(UtilMath.class, new Class[0]), UtilReflection.ERROR_CONSTRUCTOR + UtilMath.class); }