void (@NotNull List<TraceElement> values, @NotNull Function<? super TraceElement, ? extends List<TraceElement>> mapper, @NotNull Direction direction) { if (values.isEmpty()) { println(" empty", ProcessOutputTypes.SYSTEM); } for (final TraceElement element : values) { final List<TraceElement> mappedValues = mapper.apply(element); final String mapped = traceToString(mappedValues); final String line = Direction.FORWARD.equals(direction) ? element.getTime() + " -> " + mapped : mapped + " <- " + element.getTime(); println(" " + line, ProcessOutputTypes.SYSTEM); } }