code: protected String harmonizeNewlines(final String original) {
  
          final String toReturn = original.trim().replaceAll("[\r\n]+", "\n");
          return toReturn.endsWith("\n") ? toReturn : toReturn + "\n";
      }
docs: Squashes newline characters into
  
  @param original the original string, potentially containing newline characters.
  @return A string where all newline characters are removed