int (@NotNull String line, @NotNull BiConsumer<? super String, ? super Key> printer) { final LogFilterModel.MyProcessingResult processingResult = myModel.processLine(line); if (processingResult.isApplicable()) { final Key key = processingResult.getKey(); if (key != null) { final String messagePrefix = processingResult.getMessagePrefix(); if (messagePrefix != null) { printer.accept(myFormatter.formatPrefix(messagePrefix), key); } printer.accept(myFormatter.formatMessage(line) + "\n", key); return (messagePrefix != null ? messagePrefix.length() : 0) + line.length() + 1; } } return 0; }