import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.util.Arrays;

/**
 * @author Anastasiya Solodkaya.
 */
public class DropArgumentsToMatch0 {
    public static void main(String[] args) throws NoSuchMethodException, IllegalAccessException {
        MethodHandle handle1 = MethodHandles.dropArgumentsToMatch(MethodSet.find(void.class, int.class), 0, Arrays.asList(void.class, int.class), 1);
    }

    public static class MethodSet {

        private static void mVoid() {

        }

        private static void mVoid(int t) {

        }



        private static MethodHandle find(Class returnType, Class... params) throws NoSuchMethodException, IllegalAccessException {
            return find("m", MethodSet.class, returnType, params);
        }

        public static MethodHandle find(String prefix, Class targetClass, Class returnType, Class[] params) throws NoSuchMethodException, IllegalAccessException {
            String simpleName = returnType.getSimpleName();
            simpleName = simpleName.substring(0, 1).toUpperCase() + simpleName.substring(1);
            return MethodHandles.lookup().findStatic(targetClass, prefix + simpleName, MethodType.methodType(returnType, params));
        }
    }

}
