@Test
  public void testToStringWithNullComparator() {
    // Test constructor that implicitly sets a null comparator
    Filter filter = new DependentColumnFilter(FAMILIES[0], QUALIFIER);
    assertNotNull(filter.toString());
    assertTrue("check string contains 'null' as compatator is null",
      filter.toString().contains("null"));

    // Test constructor with explicit null comparator
    filter = new DependentColumnFilter(FAMILIES[0], QUALIFIER, true, CompareOperator.EQUAL, null);
    assertNotNull(filter.toString());
    assertTrue("check string contains 'null' as compatator is null",
      filter.toString().contains("null"));
  }
Test for HBASE-8794. Avoid NullPointerException in DependentColumnFilter.toString().
hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java