public static <X, Y> Ref2<X, Y> makeSecond(Y second) { Ref2<X, Y> a = new Ref2(); a.setSecond(second); return a; }