/** * Creates a closure with three free variables and binds it to the current thread * @param type1 The type of the first free variable of the newly created closure * @param type2 The type of the second free variable of the newly created closure * @param type3 The type of the third free variable of the newly created closure * @param type4 The type of the fourth free variable of the newly created closure * @return The newly created closure */ public static <A, B, C, D> Closure4<A, B, C, D> createClosure(Class<A> type1, Class<B> type2, Class<C> type3, Class<D> type4) { Closure4<A, B, C, D> closure = new Closure4<A, B, C, D>(); CLOSURES.set(closure); return closure; }