@Test
  public void testSingleRangeJunctionInACompositeGroupJunction() {
    try {
      Region r3 = CacheUtils.createRegion("employees", Employee.class);
      Set add1 = new HashSet();
      add1.add(new Address("411045", "Baner"));
      add1.add(new Address("411001", "DholePatilRd"));
      for (int i = 0; i < 4; i++) {
        r3.put(i + "", new Employee("empName", (20 + i), i, "Mr.", (5000 + i), add1));
      }
      // compileFromClause returns a List<CompiledIteratorDef>
      QCompiler compiler = new QCompiler();
      List list = compiler
          .compileFromClause(SEPARATOR + "portfolio p, p.positions," + SEPARATOR + "employees e");
      ExecutionContext context = new QueryExecutionContext(null, CacheUtils.getCache());
      context.newScope(context.associateScopeID());

      // qs.createIndex("statusIndex",
      // IndexType.FUNCTIONAL,"status","/portfolio");
      qs.createIndex("idIndex", IndexType.FUNCTIONAL, "ID", SEPARATOR + "portfolio");
      qs.createIndex("empid", IndexType.FUNCTIONAL, "empId", SEPARATOR + "employees");
      for (final Object o : list) {
        CompiledIteratorDef iterDef = (CompiledIteratorDef) o;
        context.addDependencies(new CompiledID("dummy"), iterDef.computeDependencies(context));
        RuntimeIterator rIter = iterDef.getRuntimeIterator(context);
        context.bindIterator(rIter);
        context.addToIndependentRuntimeItrMap(iterDef);
      }
      CompiledComparison[] cv = new CompiledComparison[6];
      cv[0] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "status"),
          new CompiledLiteral("active"), OQLLexerTokenTypes.TOK_EQ);
      cv[1] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "type"),
          new CompiledLiteral("type1"), OQLLexerTokenTypes.TOK_EQ);
      cv[2] = new CompiledComparison(new CompiledPath(new CompiledID("e"), "age"),
          new CompiledLiteral(1), OQLLexerTokenTypes.TOK_EQ);
      cv[3] = new CompiledComparison(new CompiledPath(new CompiledID("e"), "empId"),
          new CompiledPath(new CompiledID("p"), "ID"), OQLLexerTokenTypes.TOK_EQ);
      cv[4] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
          new CompiledLiteral(3), OQLLexerTokenTypes.TOK_GT);
      cv[5] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
          new CompiledLiteral(10), OQLLexerTokenTypes.TOK_LT);
      CompiledJunction cj = new CompiledJunction(cv, OQLLexerTokenTypes.LITERAL_and);
      context.addDependencies(new CompiledID("dummy"), cj.computeDependencies(context));
      cj.getPlanInfo(context);
      OrganizedOperands oo = cj.testOrganizedOperands(context);
      assertNotNull("OO is null", oo);
      assertTrue("Filter operand of OO not CompositeGroupJunction",
          oo.filterOperand instanceof CompositeGroupJunction);
      CompositeGroupJunction cgj = (CompositeGroupJunction) oo.filterOperand;
      List filterableCC = cgj.getFilterableCCList();
      assertTrue("No. of filterable CC  not equal to 1", filterableCC.size() == 1);
      assertNotNull("1 RangeJunction inside CompositeGroupJunction should have existed",
          cgj.getGroupJunctionList());
      assertTrue(" Complete expansion flag should have been true", cgj.getExpansionFlag());
      assertNotNull("Iter operands list in CGJ should  be not null", cgj.getIterOperands());
      List ietrOps = cgj.getIterOperands();
      assertTrue(ietrOps.contains(cv[2]));
      assertTrue(cgj.getGroupJunctionList().size() == 1);
      assertTrue(cgj.getGroupJunctionList().get(0) instanceof RangeJunction);
      RangeJunction rg = (RangeJunction) cgj.getGroupJunctionList().get(0);
      OrganizedOperands oo1 = rg.organizeOperands(context);
      assertTrue(((CompiledJunction) oo1.iterateOperand).getOperands().contains(cv[0]));
      assertTrue(((CompiledJunction) oo1.iterateOperand).getOperands().contains(cv[1]));
      assertTrue(RangeJunction.isInstanceOfDoubleCondnRangeJunctionEvaluator(oo1.filterOperand));
      assertTrue(RangeJunction.getDoubleCondnEvaluatorGreaterKey(oo1.filterOperand)
          .equals(3));
      assertTrue(
          RangeJunction.getDoubleCondnEvaluatorLESSKey(oo1.filterOperand).equals(10));
      /*
       * assertTrue( " The size of itr operands should be 3 but size happens to be = " +
       * cgj.getIterOperands().size(), cgj.getIterOperands().size() == 3);
       */
    } catch (Exception e) {
      e.printStackTrace();
      fail("Test failed sue to Exception = " + e);
    }
  }
**********************************************
AND JUNCTION TESTS. RangeJunction related tests when part of GroupJunction,
CompositeGroupJunction or AllGroupJunction
************************************************
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/CompiledJunctionInternalsJUnitTest.java