@@ -0,0 +1,1448 @@
+package org.dynalang.dynalink.support;%0A%0Aimport java.lang.invoke.MethodHandle;%0Aimport java.lang.invoke.MethodHandles;%0A%0A/**%0A * Collection of generally useful method handles.%0A */%0Apublic class UsefulHandles %7B%0A    /**%0A     * An %7B@code (Object)Z%7D method handle that returns %7B@code true%7D for any argument it receives. Basically a%0A     * %7B@code f(x) := true%7D constant function.%0A     */%0A    public static final MethodHandle RETURN_TRUE_DROP_ARG = createReturnBooleanDropArg(true);%0A    /**%0A     * An %7B@code (Object)Z%7D method handle that returns %7B@code false%7D for any argument it receives. Basically a%0A     * %7B@code f(x) := false%7D constant function.%0A     */%0A    public static final MethodHandle RETURN_FALSE_DROP_ARG = createReturnBooleanDropArg(false);%0A%0A    /**%0A     * Returns an %7B@code (Object)Z%7D method handle that returns either %7B@code true%7D or %7B@code false%7D for any argument it%0A     * is invoked for. Basically a %7B@code f(x) := b%7D constant function.%0A     * @param b the boolean value to return%0A     * @return a method handle that returns a constant boolean for any argument it is invoked with.%0A     */%0A    public static MethodHandle returnBooleanDropArg(boolean b) %7B%0A        return b ? RETURN_TRUE_DROP_ARG : RETURN_FALSE_DROP_ARG;%0A    %7D%0A%0A    @SuppressWarnings(%22boxing%22)%0A    private static MethodHandle createReturnBooleanDropArg(boolean b) %7B%0A        return MethodHandles.dropArguments(MethodHandles.constant(boolean.class, b), 0, Object.class);%0A    %7D%0A%7D%0A

Add missing file