public static String trimLines(final String text) {
        if (NullSafe.isEmptyString(text)) {
            return text;
        } else {
            return splitToLines(text, true)
                    .collect(Collectors.joining("\n"));
        }
    }
Trims all lines and removes any blank lines after trimming
stroom-util/src/main/java/stroom/util/string/StringUtil.java