Here you can find the source of getMethods(Class> type, String name)
public static Method[] getMethods(Class<?> type, String name)
//package com.java2s; //License from project: Apache License import java.lang.reflect.*; import java.util.Arrays; public class Main { public static Method[] getMethods(Class<?> type, String name) { return Arrays.stream(type.getMethods()).filter(m -> name.equals(m.getName())).toArray(Method[]::new); }//w w w . j ava 2s .co m }