Builder (@Nls @NotNull String fragmentText, @NotNull SimpleTextAttributes attributes) { if (!fragmentText.isEmpty()) { if (myLastFragmentAttributes == null && !myFragments.isEmpty()) { int size = myFragments.size(); Fragment lastFragment = myFragments.get(size - 1); if (attributes.equals(lastFragment.fragmentAttributes())) { myLastFragmentTextBuilder.append(lastFragment.fragmentText()); myFragments.remove(size - 1); } } if (!attributes.equals(myLastFragmentAttributes)) { flushLastFragment(); } myLastFragmentAttributes = attributes; myLastFragmentTextBuilder.append(fragmentText); } return this; }