Here you can find the source of getMethod(Class> clazz, String methodName, Class>... params)
public static Method getMethod(Class<?> clazz, String methodName, Class<?>... params)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; public class Main { public static Method getMethod(Class<?> clazz, String methodName, Class<?>... params) { try {//from ww w .ja va2s. com return clazz.getDeclaredMethod(methodName, params); } catch (NoSuchMethodException e) { throw new RuntimeException( String.format("Cannot find method (%s) on class (%s)", methodName, clazz.getCanonicalName()), e); } } }