Here you can find the source of getMethod(Class> clz, String name)
protected static Method getMethod(Class<?> clz, String name) throws NoSuchMethodException
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; public class Main { protected static Method getMethod(Class<?> clz, String name) throws NoSuchMethodException { return clz.getMethod("get" + name); }//from w ww .j a va 2 s.c om protected static Method getMethod(Class<?> clz, String name, Object value) throws NoSuchMethodException { Method method = null; try { method = getMethod(clz, name); } catch (NoSuchMethodException nsme) { if (Boolean.class.equals(value.getClass())) { method = clz.getMethod("is" + name); } else { throw nsme; } } return method; } }