@Test public void identityShouldReturnItselfEvenWhenNull() { List<String> eastwood = listWith(null, "good", null, "bad", "and", null, "ugly"); List<String> mappedEastwood = listFrom(Eagerly.map(eastwood, Mappers.<String>identity())); assertThat(mappedEastwood, is(eastwood)); }
public static <T> Mapper<T, T> identity() { return new Mapper<T, T>() { @Override public T map(T input) { return input; } }; }
Mappers { public static <T> Mapper<T, T> identity() { return new Mapper<T, T>() { @Override public T map(T input) { return input; } }; } }
Mappers { public static <T> Mapper<T, T> identity() { return new Mapper<T, T>() { @Override public T map(T input) { return input; } }; } private  Mappers(); }
Mappers { public static <T> Mapper<T, T> identity() { return new Mapper<T, T>() { @Override public T map(T input) { return input; } }; } private  Mappers(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Pair<S, T>> toPair(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Triple<S, T, V>> toTriple(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Quadruple<S, T, U, V>> toQuadruple(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Quintuple<R, S, T, U, V>> toQuintuple(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Sextuple<R, S, T, U, V, W>> toSextuple(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Septuple<R, S, T, U, V, W, X>> toSeptuple(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Octuple<R, S, T, U, V, W, X, Y>> toOctuple(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Nonuple<R, S, T, U, V, W, X, Y, Z>> toNonuple(); static Mapper<T, T> identity(); }
Mappers { public static <T> Mapper<T, T> identity() { return new Mapper<T, T>() { @Override public T map(T input) { return input; } }; } private  Mappers(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Pair<S, T>> toPair(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Triple<S, T, V>> toTriple(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Quadruple<S, T, U, V>> toQuadruple(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Quintuple<R, S, T, U, V>> toQuintuple(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Sextuple<R, S, T, U, V, W>> toSextuple(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Septuple<R, S, T, U, V, W, X>> toSeptuple(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Octuple<R, S, T, U, V, W, X, Y>> toOctuple(); @SuppressWarnings("unchecked") static Mapper<? super Iterable<?>, Nonuple<R, S, T, U, V, W, X, Y, Z>> toNonuple(); static Mapper<T, T> identity();  }