@Test public void mapT2() { Tuple2<Integer, String> base = Tuples.of(100, "Foo"); Tuple2<?,?> mapped = base.mapT2(String::length); assertThat(mapped).isNotSameAs(base) .hasSize(2) .containsExactly(base.getT1(), 3); }
@Test public void mapT2Null() { assertThatNullPointerException().isThrownBy(() -> Tuples.of(1, 2) .mapT2(i -> null) ).withMessage("t2"); }