@Test
  public void testBeforeCreate() {
    final MockImpl m = new MockImpl();
    final Cache c = Fakes.cache();
    final AtomicInteger counter = new AtomicInteger(0);
    final MockExtension extension = new MockExtension() {
      @Override
      public void beforeCreate(Extensible<MockInterface> source, Cache cache) {
        counter.incrementAndGet();
      }
    };

    counter.set(0);
    m.getExtensionPoint().addExtension(extension);
    // Verify beforeCreate is invoked when the extension is added
    m.extensionPoint.beforeCreate(c);
    assertEquals(1, counter.get());

    counter.set(0);
    m.getExtensionPoint().removeExtension(extension);
    // Verify beforeCreate is not invoked when the extension is removed
    m.extensionPoint.beforeCreate(c);
    assertEquals(0, counter.get());
  }
Test method for {@link SimpleExtensionPoint#beforeCreate(Cache)} .
geode-core/src/test/java/org/apache/geode/internal/cache/extension/SimpleExtensionPointJUnitTest.java