private static String getNextLabel(Map<String, String> nextLabels, List<String> missingLabels) {
    String nextLabel = nextLabels.get(missingLabels.get(0));
    while (missingLabels.contains(nextLabel)) {
      nextLabel = nextLabels.get(nextLabel);
    }
    return nextLabel;
  }
private static String getNextLabel(Map<String, String> nextLabels, List<String> missingLabels)