@Test
  public void testNestedQueryWithMultipleMatchingResultsWithIn() throws Exception {
    QueryService qs = CacheUtils.getQueryService();
    Region region1 = CacheUtils.createRegion("portfolios1", Portfolio.class);
    int numEntries = 1000;
    int numIds = 100;
    for (int i = 0; i < numEntries; i++) {
      Portfolio p = new Portfolio(i % (numIds));
      p.shortID = (short) p.ID;
      region1.put("" + i, p);
    }

    helpTestIndexForQuery(
        "<trace>SELECT * FROM " + SEPARATOR + "portfolios1 p where p.ID in (SELECT p.ID FROM "
            + SEPARATOR + "portfolios1 p WHERE p.ID = 1)",
        "p.ID", SEPARATOR + "portfolios1 p");
  }
Tests a nested query that has duplicate results in the inner query Results should not be
duplicated in the final result set
geode-core/src/integrationTest/java/org/apache/geode/cache/query/functional/NestedQueryJUnitTest.java