* @param third
* Generator for third values.
*/
public static <A, B, C> Generator<Triple<A, B, C>> triples(Generator<A> first, Generator<B> second,
Generator<C> third) {
final TupleGenerator generator = new TupleGenerator(first, second, third);
return new Generator<Triple<A, B, C>>() {
@SuppressWarnings("unchecked")
public Triple<A, B, C> next() {
Object[] next = generator.next();
return new Triple<A, B, C>((A) next[0], (B) next[1], (C) next[2]);
}
};
}