### Question:
Sextuple extends Quintuple<R, S, T, U, V> implements Sixth<W>,
                   MappableSixth<W, Sextuple<R, S, T, U, V, ?>> { @Override public <A> Sextuple<A, S, T, U, V, W> mapFirst(UnaryFunction<R, A> function) { return sextuple(function.call(getFirst()), getSecond(), 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();  }### Answer:
@Test public void shouldBeMappableUsingMapperOnFirstPosition() throws Exception { Sextuple<Integer, String, Boolean, Double, Long, Name> sextuple = tuple(5, "Five", true, 3.6, 2L, name("Ellen")); Mapper<Integer, String> mapper = new Mapper<Integer, String>() { @Override public String map(Integer input) { return String.valueOf(input); } }; Sextuple<String, String, Boolean, Double, Long, Name> expected = tuple("5", "Five", true, 3.6, 2L, name("Ellen")); Sextuple<String, String, Boolean, Double, Long, Name> actual = sextuple.mapFirst(mapper); assertThat(actual, is(expected)); }
@Test(expected = NullPointerException.class) public void shouldThrowNullPointerExceptionIfNullMapperPassedToMapFirst() throws Exception { Sextuple<Integer, String, Boolean, Double, Long, Name> sextuple = tuple(5, "Five", true, 3.6, 2L, name("Ellen")); Mapper<Integer, String> mapper = null; sextuple.mapFirst(mapper); }
@Test public void shouldBeMappableUsingUnaryFunctionOnFirstPosition() throws Exception { Sextuple<Integer, String, Boolean, Double, Long, Name> sextuple = tuple(5, "Five", true, 3.6, 2L, name("Ellen")); UnaryFunction<Integer, String> function = new UnaryFunction<Integer, String>() { @Override public String call(Integer input) { return String.valueOf(input); } }; Sextuple<String, String, Boolean, Double, Long, Name> expected = tuple("5", "Five", true, 3.6, 2L, name("Ellen")); Sextuple<String, String, Boolean, Double, Long, Name> actual = sextuple.mapFirst(function); assertThat(actual, is(expected)); }
@Test(expected = NullPointerException.class) public void shouldThrowNullPointerExceptionIfNullUnaryFunctionPassedToMapFirst() throws Exception { Sextuple<Integer, String, Boolean, Double, Long, Name> sextuple = tuple(5, "Five", true, 3.6, 2L, name("Ellen")); UnaryFunction<Integer, String> function = null; sextuple.mapFirst(function); }