@Test public void shouldBeMappableUsingUnaryFunctionOnThirdPosition() throws Exception { Sextuple<Integer, String, Boolean, Double, Long, Name> sextuple = tuple(5, "Five", true, 3.6, 2L, name("Ellen")); UnaryFunction<Boolean, String> function = new UnaryFunction<Boolean, String>() { @Override public String call(Boolean input) { return input.toString(); } }; Sextuple<Integer, String, String, Double, Long, Name> expected = tuple(5, "Five", "true", 3.6, 2L, name("Ellen")); Sextuple<Integer, String, String, Double, Long, Name> actual = sextuple.mapThird(function); assertThat(actual, is(expected)); }
@Override public <A> Sextuple<R, S, A, U, V, W> mapThird(UnaryFunction<T, A> function) { return sextuple(getFirst(), getSecond(), function.call(getThird()), getFourth(), getFifth(), getSixth()); }
Sextuple extends Quintuple<R, S, T, U, V> implements Sixth<W>,
                   MappableSixth<W, Sextuple<R, S, T, U, V, ?>> { @Override public <A> Sextuple<R, S, A, U, V, W> mapThird(UnaryFunction<T, A> function) { return sextuple(getFirst(), getSecond(), function.call(getThird()), getFourth(), getFifth(), getSixth()); } }
Sextuple extends Quintuple<R, S, T, U, V> implements Sixth<W>,
                   MappableSixth<W, Sextuple<R, S, T, U, V, ?>> { @Override public <A> Sextuple<R, S, A, U, V, W> mapThird(UnaryFunction<T, A> function) { return sextuple(getFirst(), getSecond(), function.call(getThird()), getFourth(), getFifth(), getSixth()); } Sextuple(R first, S second, T third, U fourth, V fifth, W sixth); }
Sextuple extends Quintuple<R, S, T, U, V> implements Sixth<W>,
                   MappableSixth<W, Sextuple<R, S, T, U, V, ?>> { @Override public <A> Sextuple<R, S, A, U, V, W> mapThird(UnaryFunction<T, A> function) { return sextuple(getFirst(), getSecond(), function.call(getThird()), getFourth(), getFifth(), getSixth()); } Sextuple(R first, S second, T third, U fourth, V fifth, W sixth); static Sextuple<R, S, T, U, V, W> sextuple(R first, S second, T third, U fourth, V fifth, W sixth); @Override W getSixth(); @Override Sextuple<A, S, T, U, V, W> mapFirst(UnaryFunction<R, A> function); @Override Sextuple<R, A, T, U, V, W> mapSecond(UnaryFunction<S, A> function); @Override Sextuple<R, S, A, U, V, W> mapThird(UnaryFunction<T, A> function); @Override Sextuple<R, S, T, A, V, W> mapFourth(UnaryFunction<U, A> function); @Override Sextuple<R, S, T, U, A, W> mapFifth(UnaryFunction<V, A> function); @Override Sextuple<R, S, T, U, V, A> mapSixth(UnaryFunction<W, A> function); @Override Iterable<Object> getValues(); }
Sextuple extends Quintuple<R, S, T, U, V> implements Sixth<W>,
                   MappableSixth<W, Sextuple<R, S, T, U, V, ?>> { @Override public <A> Sextuple<R, S, A, U, V, W> mapThird(UnaryFunction<T, A> function) { return sextuple(getFirst(), getSecond(), function.call(getThird()), getFourth(), getFifth(), getSixth()); } Sextuple(R first, S second, T third, U fourth, V fifth, W sixth); static Sextuple<R, S, T, U, V, W> sextuple(R first, S second, T third, U fourth, V fifth, W sixth); @Override W getSixth(); @Override Sextuple<A, S, T, U, V, W> mapFirst(UnaryFunction<R, A> function); @Override Sextuple<R, A, T, U, V, W> mapSecond(UnaryFunction<S, A> function); @Override Sextuple<R, S, A, U, V, W> mapThird(UnaryFunction<T, A> function); @Override Sextuple<R, S, T, A, V, W> mapFourth(UnaryFunction<U, A> function); @Override Sextuple<R, S, T, U, A, W> mapFifth(UnaryFunction<V, A> function); @Override Sextuple<R, S, T, U, V, A> mapSixth(UnaryFunction<W, A> function); @Override Iterable<Object> getValues();  }