@Test public void shouldBeMappableUsingUnaryFunctionOnFourthPosition() throws Exception { Octuple<Integer, String, Boolean, Double, Long, Name, Colour, Age> octuple = tuple(5, "Five", true, 3.6, 2L, name("Ellen"), colour("Green"), age(20)); UnaryFunction<Double, String> function = new UnaryFunction<Double, String>() { @Override public String call(Double input) { return input.toString(); } }; Octuple<Integer, String, Boolean, String, Long, Name, Colour, Age> expected = tuple(5, "Five", true, "3.6", 2L, name("Ellen"), colour("Green"), age(20)); Octuple<Integer, String, Boolean, String, Long, Name, Colour, Age> actual = octuple.mapFourth(function); assertThat(actual, is(expected)); }
@Override public <A> Octuple<R, S, T, A, V, W, X, Y> mapFourth(UnaryFunction<U, A> function) { return octuple(getFirst(), getSecond(), getThird(), function.call(getFourth()), getFifth(), getSixth(), getSeventh(), getEighth()); }
Octuple extends Septuple<R, S, T, U, V, W, X> implements Eighth<Y>,
                   MappableEighth<Y, Octuple<R, S, T, U, V, W, X, ?>> { @Override public <A> Octuple<R, S, T, A, V, W, X, Y> mapFourth(UnaryFunction<U, A> function) { return octuple(getFirst(), getSecond(), getThird(), function.call(getFourth()), getFifth(), getSixth(), getSeventh(), getEighth()); } }
Octuple extends Septuple<R, S, T, U, V, W, X> implements Eighth<Y>,
                   MappableEighth<Y, Octuple<R, S, T, U, V, W, X, ?>> { @Override public <A> Octuple<R, S, T, A, V, W, X, Y> mapFourth(UnaryFunction<U, A> function) { return octuple(getFirst(), getSecond(), getThird(), function.call(getFourth()), getFifth(), getSixth(), getSeventh(), getEighth()); } Octuple(R first, S second, T third, U fourth, V fifth, W sixth, X seventh, Y eighth); }
Octuple extends Septuple<R, S, T, U, V, W, X> implements Eighth<Y>,
                   MappableEighth<Y, Octuple<R, S, T, U, V, W, X, ?>> { @Override public <A> Octuple<R, S, T, A, V, W, X, Y> mapFourth(UnaryFunction<U, A> function) { return octuple(getFirst(), getSecond(), getThird(), function.call(getFourth()), getFifth(), getSixth(), getSeventh(), getEighth()); } Octuple(R first, S second, T third, U fourth, V fifth, W sixth, X seventh, Y eighth); static Octuple<R, S, T, U, V, W, X, Y> octuple(
            R first, S second, T third, U fourth, V fifth, W sixth, X seventh, Y eighth); @Override Y getEighth(); @Override Octuple<A, S, T, U, V, W, X, Y> mapFirst(UnaryFunction<R, A> function); @Override Octuple<R, A, T, U, V, W, X, Y> mapSecond(UnaryFunction<S, A> function); @Override Octuple<R, S, A, U, V, W, X, Y> mapThird(UnaryFunction<T, A> function); @Override Octuple<R, S, T, A, V, W, X, Y> mapFourth(UnaryFunction<U, A> function); @Override Octuple<R, S, T, U, A, W, X, Y> mapFifth(UnaryFunction<V, A> function); @Override Octuple<R, S, T, U, V, A, X, Y> mapSixth(UnaryFunction<W, A> function); @Override Octuple<R, S, T, U, V, W, A, Y> mapSeventh(UnaryFunction<X, A> function); @Override Octuple<R, S, T, U, V, W, X, A> mapEighth(UnaryFunction<Y, A> function); @Override Iterable<Object> getValues(); }
Octuple extends Septuple<R, S, T, U, V, W, X> implements Eighth<Y>,
                   MappableEighth<Y, Octuple<R, S, T, U, V, W, X, ?>> { @Override public <A> Octuple<R, S, T, A, V, W, X, Y> mapFourth(UnaryFunction<U, A> function) { return octuple(getFirst(), getSecond(), getThird(), function.call(getFourth()), getFifth(), getSixth(), getSeventh(), getEighth()); } Octuple(R first, S second, T third, U fourth, V fifth, W sixth, X seventh, Y eighth); static Octuple<R, S, T, U, V, W, X, Y> octuple(
            R first, S second, T third, U fourth, V fifth, W sixth, X seventh, Y eighth); @Override Y getEighth(); @Override Octuple<A, S, T, U, V, W, X, Y> mapFirst(UnaryFunction<R, A> function); @Override Octuple<R, A, T, U, V, W, X, Y> mapSecond(UnaryFunction<S, A> function); @Override Octuple<R, S, A, U, V, W, X, Y> mapThird(UnaryFunction<T, A> function); @Override Octuple<R, S, T, A, V, W, X, Y> mapFourth(UnaryFunction<U, A> function); @Override Octuple<R, S, T, U, A, W, X, Y> mapFifth(UnaryFunction<V, A> function); @Override Octuple<R, S, T, U, V, A, X, Y> mapSixth(UnaryFunction<W, A> function); @Override Octuple<R, S, T, U, V, W, A, Y> mapSeventh(UnaryFunction<X, A> function); @Override Octuple<R, S, T, U, V, W, X, A> mapEighth(UnaryFunction<Y, A> function); @Override Iterable<Object> getValues();  }