@Test public void buildScanFormPartitionPredicateLessEq() {
    // partitionConst <= partitionColumn (flip true)
    int partitionConst = 2;
    Map
        actual =
        KafkaScanTrimmer.buildScanFromPartitionPredicate(fullHouse,
            PredicateLeaf.Operator.LESS_THAN_EQUALS,
            partitionConst,
            true,
            false);

    Map
        expected =
        Maps.filterEntries(fullHouse, entry -> Objects.requireNonNull(entry).getKey().partition() >= partitionConst);
    Assert.assertEquals(expected, actual);
    Assert.assertFalse(actual.isEmpty());

    // partitionConst > partitionColumn (flip true, negation true)
    actual =
        KafkaScanTrimmer.buildScanFromPartitionPredicate(fullHouse,
            PredicateLeaf.Operator.LESS_THAN_EQUALS,
            partitionConst,
            true,
            true);

    expected =
        Maps.filterEntries(fullHouse, entry -> partitionConst > Objects.requireNonNull(entry).getKey().partition());
    Assert.assertEquals(expected, actual);
    Assert.assertFalse(actual.isEmpty());

    // partitionColumn > partitionConst (negation true)
    actual =
        KafkaScanTrimmer.buildScanFromPartitionPredicate(fullHouse,
            PredicateLeaf.Operator.LESS_THAN_EQUALS,
            partitionConst,
            false,
            true);

    expected =
        Maps.filterEntries(fullHouse, entry -> Objects.requireNonNull(entry).getKey().partition() > partitionConst);
    Assert.assertEquals(expected, actual);
    Assert.assertFalse(actual.isEmpty());

    // partitionColumn <= partitionConst (negation true)
    actual =
        KafkaScanTrimmer.buildScanFromPartitionPredicate(fullHouse,
            PredicateLeaf.Operator.LESS_THAN_EQUALS,
            partitionConst,
            false,
            false);

    expected =
        Maps.filterEntries(fullHouse, entry -> Objects.requireNonNull(entry).getKey().partition() <= partitionConst);
    Assert.assertEquals(expected, actual);
    Assert.assertFalse(actual.isEmpty());
  }
Test Class for Kafka Trimmer Class.
kafka-handler/src/test/org/apache/hadoop/hive/kafka/KafkaScanTrimmerTest.java