### Question:
ReflectionUtils { public static Method findAssociatedMethod(Object ruleClass, String methodName) throws NoSuchMethodException { Method[] methodArr = ruleClass.getClass().getDeclaredMethods(); for (Method method : methodArr) { if (methodName.equals(method.getName())) { return method; } } throw new NoSuchMethodException("unable to find "+ methodName +" method"); }  static Class<?> findAssociateClass(String ruleKey); static Class<?> findFixClass(String ruleKey); static Class<?> findAssociateClass(Class annotationClass, String hintPackage); static Method findAssociatedMethod(Object ruleClass, String methodName); static Method findEntryMethod(Object ruleClass, Class entryAnnotation); static Set<ReactorShell> findEventHandlers(String eventName);  }### Answer:
@Test public void findAssociatedMethod() throws NoSuchMethodException { assertNotNull(ReflectionUtils.findAssociatedMethod(PacmanFix.class, "getFactory")); }
@Test public void findAssociatedMethodException() throws NoSuchMethodException { assertThatThrownBy(() -> ReflectionUtils.findAssociatedMethod(PacmanFix.class, "getFactory1")).isInstanceOf(Exception.class); }