private static boolean isMatched(@NotNull String name, @NotNull List<String> branches, @NotNull List<Pattern> patterns) {
    if (branches.contains(name)) return true;
    for (Pattern regexp : patterns) {
      if (regexp.matcher(name).matches()) return true;
    }
    return false;
  }
private static boolean isMatched(@NotNull String name, @NotNull List<String> branches, @NotNull List<Pattern> patterns)