@Test
  public void delegatesToObjectInputFilterApiToCreateObjectInputFilter()
      throws InvocationTargetException, IllegalAccessException, UnableToSetSerialFilterException {
    ObjectInputFilterApi api = mock(ObjectInputFilterApi.class);
    StreamSerialFilter filter = new ReflectiveFacadeStreamSerialFilter(api, "pattern", emptySet());
    Object objectInputFilter = mock(Object.class);
    ObjectInputStream objectInputStream = mock(ObjectInputStream.class);

    when(api.createObjectInputFilterProxy(any(), any()))
        .thenReturn(objectInputFilter);

    filter.setFilterOn(objectInputStream);

    verify(api).createObjectInputFilterProxy(any(), any());
  }
The ObjectInputFilter API throws IllegalStateException nested within InvocationTargetException
if a non-null filter already exists.
geode-serialization/src/test/java/org/apache/geode/internal/serialization/filter/ReflectiveFacadeObjectInputFilterTest.java