### Question:
UtilReflection { public static <T> T getMethod(Object object, String name, Object... params) { Check.notNull(object); Check.notNull(name); Check.notNull(params); try { final Class<?> clazz = getClass(object); final Method method = clazz.getDeclaredMethod(name, getParamTypes(params)); setAccessible(method, true); @SuppressWarnings("unchecked") final T value = (T) method.invoke(object, params); return value; } catch (final NoSuchMethodException | InvocationTargetException | IllegalAccessException exception) { if (exception.getCause() instanceof LionEngineException) { throw (LionEngineException) exception.getCause(); } throw new LionEngineException(exception, ERROR_METHOD + name); } } 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 testGetMethod() { assertNotNull(UtilReflection.getMethod(new Object(), "toString")); assertNull(UtilReflection.getMethod(new Object(), "finalize")); }
@Test void testGetMethodNotAccessible() { assertThrows(() -> UtilReflection.getMethod(Verbose.class, "getMessage", "test"), UtilReflection.ERROR_METHOD + "getMessage"); }
@Test void testGetMethodNotExists() { assertThrows(() -> UtilReflection.getMethod(new Object(), "123"), UtilReflection.ERROR_METHOD + "123"); }
@Test void testGetMethodCallError() { assertThrows(() -> UtilReflection.getMethod(Integer.class, "valueOf", ""), UtilReflection.ERROR_METHOD + "valueOf"); }
@Test void testGetMethodThrowsLionEngineException() { assertThrows(() -> UtilReflection.getMethod(Reduce.class, "throwsLion"), "Lion"); }
@Test void testGetMethodInvalidParameter() { assertThrows(() -> UtilReflection.getMethod(Integer.class, "valueOf", ""), UtilReflection.ERROR_METHOD + "valueOf"); }