@Test public void mapT1() { Tuple2<String, Integer> base = Tuples.of("Foo", 200); Tuple2<?,?> mapped = base.mapT1(String::length); assertThat(mapped).isNotSameAs(base) .hasSize(2) .containsExactly(3, base.getT2()); }
@Test public void mapT1Null() { assertThatNullPointerException().isThrownBy(() -> Tuples.of(1, 2) .mapT1(i -> null) ).withMessage("t1"); }