@Test
  public void testInitFilterContext(){
    MutableFilterContext mutableFilterContext = new VectorizedRowBatch(0);
    int[] selected = makeValidSelected();

    mutableFilterContext.setFilterContext(true, selected, selected.length);
    FilterContext filterContext = mutableFilterContext.immutable();

    Assert.assertEquals(true, filterContext.isSelectedInUse());
    Assert.assertEquals(512, filterContext.getSelectedSize());
    Assert.assertEquals(512, filterContext.getSelected().length);
  }
Test creation and manipulation of MutableFilterContext and FilterContext.
ql/src/test/org/apache/hadoop/hive/ql/io/filter/TestFilterContext.java