void (Function<ATest, String> nameF) { Function<ATest, String> aTestStringFunction = nameF.andThen(ATest::withUnderscore); Function<ATest, String> aTestStringFunction1 = nameF.andThen((s) -> {return ATest.withUnderscore(s);}); Function<ATest, String> aTestStringFunction2 = nameF.andThen((String s) -> ATest.withUnderscore(s)); System.out.println(aTestStringFunction); System.out.println(aTestStringFunction1); System.out.println(aTestStringFunction2); }