### Question:
BeanUtils { public static Method resolveMethod(Class clazz, String methodName, int argCount) throws SynapseException { Method resolvedMethod = null; for (Method method : clazz.getMethods()) { if (method.getName().equals(methodName) && method.getParameterTypes().length == argCount) { if (resolvedMethod == null) { resolvedMethod = method; } else { throw new SynapseException("More than one '" + methodName + "' methods " + "that take " + argCount + " arguments are found in '" + clazz.getName() + "' class."); } } } return resolvedMethod; }  static Object invokeInstanceMethod(Object instance, Method method, Object[] args); static Method resolveMethod(Class clazz, String methodName, int argCount);  }### Answer:
@Test public void testBeanUtilResolve() { Method method = BeanUtils.resolveMethod(SampleBean.class, "setTestProperty", 1); Assert.assertNotNull("method exist with given name and argument count", method); }
@Test public void testBeanUtilResolveInvalid() { Method method = BeanUtils.resolveMethod(SampleBean.class, "setTestProperty", 2); Assert.assertNull("method not exists with given name and argument count", method); }