/** * Create a new SmartHandle that casts arguments from the given return * type and argument types to the current signature's type, using the same * argument names. This casting is equivalent to MethodHandle#asType. * * @param returnType the return type of the new handle * @param argTypes the argument types of the new handle * @return a new SmartHandle that accepts the given argument types */ public SmartHandle cast(Class<?> returnType, Class<?>... argTypes) { return cast(MethodType.methodType(returnType, argTypes)); }