void (@NotNull CharSequence chars, int start, int end, @NotNull TextAttributes originalAttrs, boolean bold, @NotNull List<? super @NotNull TextChunk> result) { if (start < end) { TextAttributes attrs = bold ? TextAttributes.merge(originalAttrs, new TextAttributes(null, null, null, null, Font.BOLD)) : originalAttrs; result.add(new TextChunk(attrs, new String(CharArrayUtil.fromSequence(chars, start, end)))); } }