@Test
  public void testGetAllNotMatching() throws Exception {
    int numEntries = 20;
    his = createHashIndexSet();
    Map<Integer, Portfolio> collectionOfPorts1 = createPortfolioObjects(numEntries, 0);
    Map<Integer, Portfolio> collectionOfPorts2 =
        createPortfolioObjects(numEntries, numEntries);

    addPortfoliosToHashIndexSet(collectionOfPorts1, his);
    addPortfoliosToHashIndexSet(collectionOfPorts2, his);

    assertEquals(numEntries * 2, his.size());
    List<Integer> keysNotToMatch = new LinkedList<>();
    keysNotToMatch.add(3);
    keysNotToMatch.add(4);
    Iterator iterator = his.getAllNotMatching(keysNotToMatch);
    int numIterated = 0;
    while (iterator.hasNext()) {
      numIterated++;
      int idFound = ((Portfolio) iterator.next()).indexKey;
      assertTrue(idFound != 3 && idFound != 4);
    }
    // Make sure we iterated all the entries minus the entries that we decided not to match
    assertEquals(numEntries * 2 - 4, numIterated);
  }
we have to be sure that we dont cause a compaction or growth or else removed tokens will be
removed and a new backing array created
geode-core/src/test/java/org/apache/geode/cache/query/internal/index/HashIndexSetJUnitTest.java