@Override
      public void beforeDestroy2(EntryEvent event) throws CacheWriterException {

        assertEquals(key, event.getKey());
        assertEquals(value, event.getOldValue());
        assertNull(event.getNewValue());
        assertTrue(event.getOperation().isDestroy());
        assertFalse(event.getOperation().isLoad());
        assertFalse(event.getOperation().isLocalLoad());
        assertFalse(event.getOperation().isNetLoad());
        assertFalse(event.getOperation().isNetSearch());

        Object argument = event.getCallbackArgument();
        if (argument != null) {
          if (argument.equals(exception)) {
            String s = "Test CacheWriterException";
            throw new CacheWriterException(s);

          } else {
            assertEquals(arg, argument);
          }
        }
      }
Tests that the <code>CacheWriter</code> is called before an entry is
{@linkplain CacheWriter#beforeDestroy destroyed}.
geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheWriterTestCase.java