private void setCallbacks(AttributesFactory af) {
    CacheListener cl1 = new CacheListener() {
      @Override
      public void afterUpdate(EntryEvent e) {
        clLastEvent = e;
        clInvokeCount++;
      }

      @Override
      public void afterCreate(EntryEvent e) {
        clLastEvent = e;
        clInvokeCount++;
      }

      @Override
      public void afterInvalidate(EntryEvent e) {
        clLastEvent = e;
        clInvokeCount++;
      }

      @Override
      public void afterDestroy(EntryEvent e) {
        clLastEvent = e;
        clInvokeCount++;
      }

      @Override
      public void afterRegionInvalidate(RegionEvent e) {
        clLastEvent = e;
        clInvokeCount++;
      }

      @Override
      public void afterRegionDestroy(RegionEvent e) {
        clLastEvent = e;
        clInvokeCount++;
      }

      @Override
      public void afterRegionClear(RegionEvent e) {
        clLastEvent = e;
        clInvokeCount++;
      }

      @Override
      public void afterRegionCreate(RegionEvent e) {
        clLastEvent = e;
        clInvokeCount++;
      }

      @Override
      public void afterRegionLive(RegionEvent e) {
        clLastEvent = e;
        clInvokeCount++;
      }

      @Override
      public void close() {
        clClosed = true;
      }
    };
    CacheWriter cw = new CacheWriter() {
      @Override
      public void beforeUpdate(EntryEvent e) throws CacheWriterException {
        cwLastEvent = e;
        cwInvokeCount++;
      }

      @Override
      public void beforeCreate(EntryEvent e) throws CacheWriterException {
        cwLastEvent = e;
        cwInvokeCount++;
      }

      @Override
      public void beforeDestroy(EntryEvent e) throws CacheWriterException {
        cwLastEvent = e;
        cwInvokeCount++;
      }

      @Override
      public void beforeRegionDestroy(RegionEvent e) throws CacheWriterException {
        cwLastEvent = e;
        cwInvokeCount++;
      }

      @Override
      public void beforeRegionClear(RegionEvent e) throws CacheWriterException {
        cwLastEvent = e;
        cwInvokeCount++;
      }

      @Override
      public void close() {
        cwClosed = true;
      }
    };
    af.addCacheListener(cl1);
    af.setCacheWriter(cw);
    {
      TransactionListener tl = new TransactionListenerAdapter() {
        @Override
        public void afterCommit(TransactionEvent e) {
          tlLastEvents = e.getEvents();
          tlInvokeCount++;
        }

        @Override
        public void close() {
          tlClosed = true;
        }
      };
      CacheTransactionManager ctm = c.getCacheTransactionManager();
      ctm.addListener(tl);
    }
  }
Used to check to see if EntryEvent was what was expected
geode-core/src/integrationTest/java/org/apache/geode/cache/ProxyJUnitTest.java