@Test
public void testSetFilter() throws IOException {

  ThemisRead[] readers = new ThemisRead[] { new ThemisGet(ROW), new ThemisScan() };
  for (ThemisRead reader : readers) {
    reader.setFilter(null);
    Assert.assertNull(reader.getFilter());
    
    // illegal Filter class directly
    try {
      reader.setFilter(new DependentColumnFilter());
      Assert.fail();
    } catch (IOException e) {}
    // illegal Filter class in FilterList
    FilterList filterList = new FilterList();
    filterList.addFilter(new PrefixFilter());
    filterList.addFilter(new ColumnRangeFilter());
    try {
      reader.setFilter(new DependentColumnFilter());
      Assert.fail();
    } catch (IOException e) {}
    
    reader.setFilter(new PrefixFilter());
    Assert.assertEquals(PrefixFilter.class.getName(), reader.getFilter().getClass().getName());
    filterList = new FilterList();
    filterList.addFilter(new PrefixFilter());
    reader.setFilter(filterList);
    Assert.assertEquals(FilterList.class.getName(), reader.getFilter().getClass().getName());
  }
}