@Nullable
  private static Pair<List<String>, Boolean> keysOrder(final ResourceBundle resourceBundle) {
    final List<PropertiesOrder> propertiesOrders =
      ContainerUtil.map(resourceBundle.getPropertiesFiles(), PropertiesOrder::new);

    final boolean[] isAlphaSorted = new boolean[]{true};
    final Graph<String> generator = GraphGenerator.generate(CachingSemiGraph.cache(new InboundSemiGraph<>() {
      @NotNull
      @Override
      public Collection<String> getNodes() {
        final Set<String> nodes = new LinkedHashSet<>();
        for (PropertiesOrder order : propertiesOrders) {
          nodes.addAll(order.myKeys);
        }
        return nodes;
      }

      @NotNull
      @Override
      public Iterator<String> getIn(String n) {
        final Collection<String> siblings = new LinkedHashSet<>();

        for (PropertiesOrder order : propertiesOrders) {
          for (String nextKey : order.getNext(n)) {
            if (isAlphaSorted[0] && String.CASE_INSENSITIVE_ORDER.compare(n, nextKey) > 0) {
              isAlphaSorted[0] = false;
            }
            siblings.add(nextKey);
          }
        }

        return siblings.iterator();
      }
    }));
    DFSTBuilder<String> dfstBuilder = new DFSTBuilder<>(generator);
    boolean acyclic = dfstBuilder.isAcyclic();
    if (acyclic) {
      List<String> sortedNodes = new ArrayList<>(generator.getNodes());
      if (isAlphaSorted[0]) {
        sortedNodes.sort(String.CASE_INSENSITIVE_ORDER);
        return new Pair<>(sortedNodes, true);
      }
      else {
        sortedNodes.sort(dfstBuilder.comparator().reversed());
        return new Pair<>(sortedNodes, false);
      }
    }
    else {
      return null;
    }
  }
@Nullable
  private static Pair<List<String>, Boolean> keysOrder(final ResourceBundle resourceBundle)