public TextBuffer appendPossibleNewline(String alternative, boolean dedent) {
    myCurrentGroup.myReplacements.add(new NewlineGroup.Replacement(myStringBuilder.length(), alternative.length(), dedent));
    return append(alternative);
  }
If the current group is applied, add a newline here. Otherwise, add the argument.
If {@code dedent} is true, the extra indent from this group is unapplied from this point on.
src/org/jetbrains/java/decompiler/util/TextBuffer.java