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