Java tutorial
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; public class Main { static Method getMethod(Class clazz, String methodName) { final Method[] methods = clazz.getMethods(); for (Method method : methods) { if (method.getName().equals(methodName)) { method.setAccessible(true); return method; } } return null; } }