Here you can find the source of getMethod(String methodName, Class> type)
public static Method getMethod(String methodName, Class<?> type)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; public class Main { public static Method getMethod(String methodName, Class<?> type) { try {/*www . j a v a 2 s . c o m*/ Method method = type.getDeclaredMethod(methodName); if (!method.isAccessible()) { method.setAccessible(true); } return method; } catch (Exception e) { throw new UnsupportedOperationException(String.format( "Method %s could not be proccessed. Check if this method is accessible.", methodName), e); } } }