@Test
  public void testNotEqualConditionEvaluator_AND() {
    LogWriter logger = CacheUtils.getLogger();
    try {
      CompiledComparison[] cv = null;
      ExecutionContext context = new QueryExecutionContext(null, CacheUtils.getCache());
      bindIteratorsAndCreateIndex(context);
      /**
       * ******************For all LESS THAN OR LESS THAN EQUAL To ********************
       */
      // Case 1 : a != 7 and a !=4 and a != 5 and a != 5
      cv = new CompiledComparison[4];
      cv[0] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
          new CompiledLiteral(7), OQLLexerTokenTypes.TOK_NE);
      cv[1] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
          new CompiledLiteral(4), OQLLexerTokenTypes.TOK_NE);
      cv[2] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
          new CompiledLiteral(5), OQLLexerTokenTypes.TOK_NE);
      cv[3] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
          new CompiledLiteral(5), OQLLexerTokenTypes.TOK_NE);

      OrganizedOperands oo =
          oganizedOperandsSingleRangeJunctionCreation(OQLLexerTokenTypes.LITERAL_and, cv, context);
      assertTrue("Filter Openad of OrganizedOperand is not of type RangeJunction",
          oo.filterOperand instanceof RangeJunction);
      RangeJunction rj = (RangeJunction) oo.filterOperand;
      OrganizedOperands oo1 = rj.organizeOperands(context);
      assertTrue(RangeJunction.isInstanceOfNotEqualConditionEvaluator(oo1.filterOperand));
      Set keysRemove = RangeJunction.getKeysToBeRemoved(oo1.filterOperand);
      assertTrue(keysRemove.size() == 3);
      assertTrue(keysRemove.contains(5));
      assertTrue(keysRemove.contains(7));
      assertTrue(keysRemove.contains(4));
      // Case 2 : a != 7 and a != null and a != undefined
      CompiledValue[] cv1 = new CompiledValue[3];
      cv1[0] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
          new CompiledLiteral(7), OQLLexerTokenTypes.TOK_NE);
      cv1[1] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
          new CompiledLiteral(null), OQLLexerTokenTypes.TOK_NE);
      cv1[2] = new CompiledUndefined(new CompiledPath(new CompiledID("p"), "ID"), false);

      oo = oganizedOperandsSingleRangeJunctionCreation(OQLLexerTokenTypes.LITERAL_and, cv1,
          context);
      assertTrue("Filter Openad of OrganizedOperand is not of type RangeJunction",
          oo.filterOperand instanceof RangeJunction);
      rj = (RangeJunction) oo.filterOperand;
      oo1 = rj.organizeOperands(context);
      assertTrue(oo1.filterOperand instanceof GroupJunction);
      CompiledValue[] ops = ((GroupJunction) oo1.filterOperand)._operands;
      // assertTrue(cv1[0] == ops[0] || cv1[0] == ops[1] || cv1[0] == ops[2]);
      if (RangeJunction.isInstanceOfNotEqualConditionEvaluator(ops[0])) {
        assertTrue(
            RangeJunction.getKeysToBeRemoved(ops[0]).iterator().next().equals(7));
      } else if (RangeJunction.isInstanceOfNotEqualConditionEvaluator(ops[1])) {
        assertTrue(
            RangeJunction.getKeysToBeRemoved(ops[1]).iterator().next().equals(7));
      } else if (RangeJunction.isInstanceOfNotEqualConditionEvaluator(ops[2])) {
        assertTrue(
            RangeJunction.getKeysToBeRemoved(ops[2]).iterator().next().equals(7));
      } else {
        fail("NotEqualConditionEvaluator not found");
      }
      assertTrue(cv1[1] == ops[0] || cv1[1] == ops[1] || cv1[1] == ops[2]);
      assertTrue(cv1[2] == ops[0] || cv1[2] == ops[1] || cv1[2] == ops[2]);
    } catch (Exception e) {
      logger.error(e.toString());
      fail(e.toString());
    }
  }
Tests the correct creation of NotEqualConditionEvaluator For AND junction
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/CompiledJunctionInternalsJUnitTest.java