Set<String> (@NotNull HgCommandResult result) { Set<String> branches = new TreeSet<>(); for (final String line : result.getOutputLines()) { Matcher matcher = BRANCH_LINE.matcher(line); if (matcher.matches()) { branches.add(matcher.group(NAME_INDEX).trim()); } } return branches; }