@Test public void shouldBeMappableUsingMapperOnThirdPosition() throws Exception { Quintuple<Integer, String, Boolean, Double, Long> quintuple = tuple(5, "Five", true, 3.6, 2L); Mapper<Boolean, String> mapper = new Mapper<Boolean, String>() { @Override public String map(Boolean input) { return input.toString(); } }; Quintuple<Integer, String, String, Double, Long> expected = tuple(5, "Five", "true", 3.6, 2L); Quintuple<Integer, String, String, Double, Long> actual = quintuple.mapThird(mapper); assertThat(actual, is(expected)); }
@Override public <A> Quintuple<R, S, A, U, V> mapThird(UnaryFunction<T, A> function) { return quintuple(getFirst(), getSecond(), function.call(getThird()), getFourth(), getFifth()); }
Quintuple extends Quadruple<R, S, T, U> implements Fifth<V>,
                   MappableFifth<V, Quintuple<R, S, T, U, ?>> { @Override public <A> Quintuple<R, S, A, U, V> mapThird(UnaryFunction<T, A> function) { return quintuple(getFirst(), getSecond(), function.call(getThird()), getFourth(), getFifth()); } }
Quintuple extends Quadruple<R, S, T, U> implements Fifth<V>,
                   MappableFifth<V, Quintuple<R, S, T, U, ?>> { @Override public <A> Quintuple<R, S, A, U, V> mapThird(UnaryFunction<T, A> function) { return quintuple(getFirst(), getSecond(), function.call(getThird()), getFourth(), getFifth()); } Quintuple(R first, S second, T third, U fourth, V fifth); }
Quintuple extends Quadruple<R, S, T, U> implements Fifth<V>,
                   MappableFifth<V, Quintuple<R, S, T, U, ?>> { @Override public <A> Quintuple<R, S, A, U, V> mapThird(UnaryFunction<T, A> function) { return quintuple(getFirst(), getSecond(), function.call(getThird()), getFourth(), getFifth()); } Quintuple(R first, S second, T third, U fourth, V fifth); static Quintuple<R, S, T, U, V> quintuple(R first, S second, T third, U fourth, V fifth); @Override V getFifth(); @Override Quintuple<A, S, T, U, V> mapFirst(UnaryFunction<R, A> function); @Override Quintuple<R, A, T, U, V> mapSecond(UnaryFunction<S, A> function); @Override Quintuple<R, S, A, U, V> mapThird(UnaryFunction<T, A> function); @Override Quintuple<R, S, T, A, V> mapFourth(UnaryFunction<U, A> function); @Override Quintuple<R, S, T, U, A> mapFifth(UnaryFunction<V, A> function); @Override Iterable<Object> getValues(); }
Quintuple extends Quadruple<R, S, T, U> implements Fifth<V>,
                   MappableFifth<V, Quintuple<R, S, T, U, ?>> { @Override public <A> Quintuple<R, S, A, U, V> mapThird(UnaryFunction<T, A> function) { return quintuple(getFirst(), getSecond(), function.call(getThird()), getFourth(), getFifth()); } Quintuple(R first, S second, T third, U fourth, V fifth); static Quintuple<R, S, T, U, V> quintuple(R first, S second, T third, U fourth, V fifth); @Override V getFifth(); @Override Quintuple<A, S, T, U, V> mapFirst(UnaryFunction<R, A> function); @Override Quintuple<R, A, T, U, V> mapSecond(UnaryFunction<S, A> function); @Override Quintuple<R, S, A, U, V> mapThird(UnaryFunction<T, A> function); @Override Quintuple<R, S, T, A, V> mapFourth(UnaryFunction<U, A> function); @Override Quintuple<R, S, T, U, A> mapFifth(UnaryFunction<V, A> function); @Override Iterable<Object> getValues();  }