@Override
    public Object answer(InvocationOnMock invocation) throws Throwable {
      countOperations.answer(invocation);
      Method m = invocation.getMethod();
      return m.invoke(region, invocation.getArguments());
    }
A wrapper around an object that will also invoke a callback before applying an operation.

This is essentially like Mockito.spy(), except that it allows the implementation of a default
answer for all operations.

To use, do this Mockito.mock(Interface, new SpyWrapper(Answer, o)
geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/filesystem/FileSystemJUnitTest.java