code: private static void removePartialRows(List<ExpandedPair> pairs, List<ExpandedRow> rows) {
      for (Iterator<ExpandedRow> iterator = rows.iterator(); iterator.hasNext();) {
        ExpandedRow r = iterator.next();
        if (r.getPairs().size() == pairs.size()) {
          continue;
        }
        boolean allFound = true;
        for (ExpandedPair p : r.getPairs()) {
          boolean found = false;
          for (ExpandedPair pp : pairs) {
            if (p.equals(pp)) {
              found = true;
              break;
            }
          }
          if (!found) {
            allFound = false;
            break;
          }
        }
        if (allFound) {
          // 'pairs' contains all the pairs from the row 'r'
          iterator.remove();
        }
      }
    }
docs: Remove all the rows that contains only specified pairs