@Test
public void testLogAndRestream() {

    final Set<Result<String>> original = Stream.of("a", "b", "c")
            .map(Result::success).collect(Collectors.toSet());
    assertEquals("original same as collected", original,
            original.stream().collect(Result.logAndRestream()).collect(Collectors.toSet()));
    assertEquals("original same as collected with message", original,
            original.stream().collect(Result.logAndRestream("collect message")).collect(Collectors.toSet()));
    assertEquals("original same as collected", original, original.stream()
            .collect(new Result.RestreamLogCollector<>(LoggerFactory.getLogger(specialLoggerError), "withError"))
            .collect(Collectors.toSet()));
}