List<String> (@NotNull Iterable<String> lines, boolean ignoreFirstLine, final String newIndent) { final String oldIndent = findCommonIndent(lines, ignoreFirstLine); if (Iterables.isEmpty(lines)) { return Collections.emptyList(); } final List<String> result = ContainerUtil.map(Iterables.skip(lines, ignoreFirstLine ? 1 : 0), line -> { if (StringUtil.isEmptyOrSpaces(line)) { return ""; } else { return newIndent + line.substring(oldIndent.length()); } }); if (ignoreFirstLine) { return ContainerUtil.prepend(result, Iterables.get(lines, 0)); } return result; }