geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [47/63] [abbrv] incubator-geode git commit: Automatically converting calls of vm.invoke to lambdas
Date Fri, 19 Feb 2016 18:37:24 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java
index 9a50146..7ef1a0d 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java
@@ -158,33 +158,32 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
     VM2 = host.getVM(2);
     VM3 = host.getVM(3);
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "resetAll");
-    VM1.invoke(DeltaPropagationDUnitTest.class, "resetAll");
-    VM2.invoke(DeltaPropagationDUnitTest.class, "resetAll");
-    VM3.invoke(DeltaPropagationDUnitTest.class, "resetAll");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.resetAll());
+    VM1.invoke(() -> DeltaPropagationDUnitTest.resetAll());
+    VM2.invoke(() -> DeltaPropagationDUnitTest.resetAll());
+    VM3.invoke(() -> DeltaPropagationDUnitTest.resetAll());
     DeltaPropagationDUnitTest.resetAll();
   }
 
   @Override
   protected final void preTearDown() throws Exception {
     DeltaPropagationDUnitTest.closeCache();
-    VM2.invoke(DeltaPropagationDUnitTest.class, "closeCache");
-    VM3.invoke(DeltaPropagationDUnitTest.class, "closeCache");
+    VM2.invoke(() -> DeltaPropagationDUnitTest.closeCache());
+    VM3.invoke(() -> DeltaPropagationDUnitTest.closeCache());
 
     // Unset the isSlowStartForTesting flag
-    VM0.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
-    VM1.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
+    VM0.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
+    VM1.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
     // then close the servers
-    VM0.invoke(DeltaPropagationDUnitTest.class, "closeCache");
-    VM1.invoke(DeltaPropagationDUnitTest.class, "closeCache");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.closeCache());
+    VM1.invoke(() -> DeltaPropagationDUnitTest.closeCache());
     disconnectAllFromDS();
   }
 
   public void testS2CSuccessfulDeltaPropagationWithCompression() throws Exception {
-    PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache", new Object[] {
+    PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache(
             HARegionQueue.HA_EVICTION_POLICY_NONE, new Integer(1),
-            new Integer(NO_LISTENER), Boolean.FALSE, compressor })).intValue();
+            new Integer(NO_LISTENER), Boolean.FALSE, compressor ))).intValue();
     
     VM0.invoke(new SerializableRunnable() {
       public void run() { assertTrue(cache.getRegion(regionName).getAttributes().getCompressor() != null); }
@@ -195,14 +194,14 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
     
     registerInterestListAll();
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
     prepareDeltas();
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "createAndUpdateDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.createAndUpdateDeltas());
     
     waitForLastKey();
     
-    long toDeltas = ((Long)VM0.invoke(DeltaTestImpl.class, "getToDeltaInvokations"));
+    long toDeltas = ((Long)VM0.invoke(() -> DeltaTestImpl.getToDeltaInvokations()));
     long fromDeltas = DeltaTestImpl.getFromDeltaInvokations();
     assertTrue((EVENTS_SIZE - 1) + " deltas were to be sent but were "
         + toDeltas, toDeltas == (EVENTS_SIZE - 1));
@@ -214,22 +213,20 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
   }
   
   public void testS2CSuccessfulDeltaPropagation() throws Exception {
-    PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache",
-        new Object[] { HARegionQueue.HA_EVICTION_POLICY_MEMORY })).intValue();
+    PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
     createClientCache(new Integer(PORT1), new Integer(-1), "0", new Integer(
         CLIENT_LISTENER));
     registerInterestListAll();
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
     prepareDeltas();
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "createAndUpdateDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.createAndUpdateDeltas());
 
     waitForLastKey();
     
-    long toDeltas = ((Long)VM0.invoke(DeltaTestImpl.class, "getToDeltaInvokations"));
+    long toDeltas = ((Long)VM0.invoke(() -> DeltaTestImpl.getToDeltaInvokations()));
     long fromDeltas = DeltaTestImpl.getFromDeltaInvokations();
     assertTrue((EVENTS_SIZE - 1) + " deltas were to be sent but were "
         + toDeltas, toDeltas == (EVENTS_SIZE - 1));
@@ -241,25 +238,22 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
   }
 
   public void testS2CFailureInToDeltaMethod() throws Exception {
-    PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache",
-        new Object[] { HARegionQueue.HA_EVICTION_POLICY_MEMORY })).intValue();
+    PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
     createClientCache(new Integer(PORT1), new Integer(-1), "0", new Integer(
         CLIENT_LISTENER_2));
     registerInterestListAll();
 
-    VM0.invoke(DeltaPropagationDUnitTest.class,
-        "prepareErroneousDeltasForToDelta");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.prepareErroneousDeltasForToDelta());
     prepareErroneousDeltasForToDelta();
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "createAndUpdateDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.createAndUpdateDeltas());
 
     waitForLastKey();
 
-    long toDeltas = ((Long)VM0.invoke(DeltaTestImpl.class, "getToDeltaInvokations"));
+    long toDeltas = ((Long)VM0.invoke(() -> DeltaTestImpl.getToDeltaInvokations()));
     long fromDeltas = DeltaTestImpl.getFromDeltaInvokations();
-    long toDeltafailures = ((Long)VM0.invoke(DeltaTestImpl.class, "getToDeltaFailures"));
+    long toDeltafailures = ((Long)VM0.invoke(() -> DeltaTestImpl.getToDeltaFailures()));
     assertTrue((EVENTS_SIZE - 1) + " deltas were to be sent but were "
         + toDeltas, toDeltas == (EVENTS_SIZE - 1));
     assertTrue(
@@ -278,23 +272,20 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
   }
 
   public void testS2CFailureInFromDeltaMethod() throws Exception {
-    PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache",
-        new Object[] { HARegionQueue.HA_EVICTION_POLICY_MEMORY })).intValue();
+    PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
     createClientCache(new Integer(PORT1), new Integer(-1), "0", new Integer(
         CLIENT_LISTENER));
     registerInterestListAll();
 
-    VM0.invoke(DeltaPropagationDUnitTest.class,
-        "prepareErroneousDeltasForFromDelta");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.prepareErroneousDeltasForFromDelta());
     prepareErroneousDeltasForFromDelta();
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "createAndUpdateDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.createAndUpdateDeltas());
 
     waitForLastKey();
 
-    long toDeltas = ((Long)VM0.invoke(DeltaTestImpl.class, "getToDeltaInvokations"));
+    long toDeltas = ((Long)VM0.invoke(() -> DeltaTestImpl.getToDeltaInvokations()));
     long fromDeltas = DeltaTestImpl.getFromDeltaInvokations();
     long fromDeltafailures = DeltaTestImpl.getFromDeltaFailures();
     assertTrue((EVENTS_SIZE - 1) + " deltas were to be sent but were "
@@ -309,9 +300,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
   }
 
   public void testS2CWithOldValueAtClientOverflownToDisk() throws Exception {
-    PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache",
-        new Object[] { HARegionQueue.HA_EVICTION_POLICY_MEMORY })).intValue();
+    PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
     EvictionAttributes evAttr = EvictionAttributes.createLRUEntryAttributes(1,
         EvictionAction.OVERFLOW_TO_DISK);
@@ -320,20 +309,19 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
         Boolean.TRUE/* add listener */, evAttr);
     registerInterestListAll();
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
     prepareDeltas();
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "createDelta");
-    VM0.invoke(DeltaPropagationDUnitTest.class, "createAnEntry");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.createDelta());
+    VM0.invoke(() -> DeltaPropagationDUnitTest.createAnEntry());
     Thread.sleep(5000); // TODO: Find a better 'n reliable alternative
     // assert overflow occured on client vm
     verifyOverflowOccured(1L, 2);
-    VM0.invoke(DeltaPropagationDUnitTest.class, "updateDelta");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.updateDelta());
 
     waitForLastKey();
 
-    long toDeltas = ((Long)VM0.invoke(DeltaTestImpl.class,
-        "getToDeltaInvokations")).longValue();
+    long toDeltas = ((Long)VM0.invoke(() -> DeltaTestImpl.getToDeltaInvokations())).longValue();
     long fromDeltas = DeltaTestImpl.getFromDeltaInvokations().longValue();
 
     assertTrue((EVENTS_SIZE - 1) + " deltas were to be sent but were "
@@ -346,9 +334,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
   }
 
   public void testS2CWithLocallyDestroyedOldValueAtClient() throws Exception {
-    PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache",
-        new Object[] { HARegionQueue.HA_EVICTION_POLICY_MEMORY })).intValue();
+    PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
     EvictionAttributes evAttr = EvictionAttributes.createLRUEntryAttributes(1,
         EvictionAction.LOCAL_DESTROY);
@@ -357,20 +343,19 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
         Boolean.TRUE/* add listener */, evAttr);
     registerInterestListAll();
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
     prepareDeltas();
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "createDelta");
-    VM0.invoke(DeltaPropagationDUnitTest.class, "createAnEntry");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.createDelta());
+    VM0.invoke(() -> DeltaPropagationDUnitTest.createAnEntry());
     Thread.sleep(5000); // TODO: Find a better 'n reliable alternative
     // assert overflow occured on client vm
     verifyOverflowOccured(1L, 1);
-    VM0.invoke(DeltaPropagationDUnitTest.class, "updateDelta");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.updateDelta());
 
     waitForLastKey();
 
-    long toDeltas = ((Long)VM0.invoke(DeltaTestImpl.class,
-        "getToDeltaInvokations")).longValue();
+    long toDeltas = ((Long)VM0.invoke(() -> DeltaTestImpl.getToDeltaInvokations())).longValue();
     long fromDeltas = DeltaTestImpl.getFromDeltaInvokations().longValue();
 
     assertTrue((EVENTS_SIZE - 1) + " deltas were to be sent but were "
@@ -383,25 +368,22 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
   }
 
   public void testS2CWithInvalidatedOldValueAtClient() throws Exception {
-    PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache",
-        new Object[] { HARegionQueue.HA_EVICTION_POLICY_MEMORY })).intValue();
+    PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
     createClientCache(new Integer(PORT1), new Integer(-1), "0", new Integer(
         CLIENT_LISTENER));
     registerInterestListAll();
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
     prepareDeltas();
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "createDelta");
-    VM0.invoke(DeltaPropagationDUnitTest.class, "invalidateDelta");
-    VM0.invoke(DeltaPropagationDUnitTest.class, "updateDelta");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.createDelta());
+    VM0.invoke(() -> DeltaPropagationDUnitTest.invalidateDelta());
+    VM0.invoke(() -> DeltaPropagationDUnitTest.updateDelta());
 
     waitForLastKey();
 
-    long toDeltas = ((Long)VM0.invoke(DeltaTestImpl.class,
-        "getToDeltaInvokations")).longValue();
+    long toDeltas = ((Long)VM0.invoke(() -> DeltaTestImpl.getToDeltaInvokations())).longValue();
     long fromDeltas = DeltaTestImpl.getFromDeltaInvokations().longValue();
 
     assertTrue((EVENTS_SIZE - 1) + " deltas were to be sent but were "
@@ -415,18 +397,16 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
   }
 
   public void testS2CDeltaPropagationWithClientConflationON() throws Exception {
-    PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache",
-        new Object[] { HARegionQueue.HA_EVICTION_POLICY_MEMORY })).intValue();
+    PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
     createClientCache(new Integer(PORT1), new Integer(-1), "0",
         DistributionConfig.CLIENT_CONFLATION_PROP_VALUE_ON, new Integer(
             LAST_KEY_LISTENER), null, null);
 
     registerInterestListAll();
-    VM0.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "createAndUpdateDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.createAndUpdateDeltas());
 
     waitForLastKey();
 
@@ -436,53 +416,48 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
   }
 
   public void testS2CDeltaPropagationWithServerConflationON() throws Exception {
-    VM0.invoke(DeltaPropagationDUnitTest.class, "closeCache");
-    PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache", new Object[] {
+    VM0.invoke(() -> DeltaPropagationDUnitTest.closeCache());
+    PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache(
             HARegionQueue.HA_EVICTION_POLICY_MEMORY, Integer.valueOf(1),
-            Integer.valueOf(NO_LISTENER), Boolean.TRUE /* conflate */, null}))
+            Integer.valueOf(NO_LISTENER), Boolean.TRUE /* conflate */, null)))
         .intValue();
 
     createClientCache(new Integer(PORT1), new Integer(-1), "0",
         DistributionConfig.CLIENT_CONFLATION_PROP_VALUE_DEFAULT, new Integer(
             LAST_KEY_LISTENER), null, null);
 
-    VM3.invoke(DeltaPropagationDUnitTest.class, "createClientCache",
-        new Object[] { new Integer(PORT1), new Integer(-1), "0",
+    VM3.invoke(() -> DeltaPropagationDUnitTest.createClientCache( new Integer(PORT1), new Integer(-1), "0",
             DistributionConfig.CLIENT_CONFLATION_PROP_VALUE_OFF,
-            new Integer(LAST_KEY_LISTENER), null, null });
+            new Integer(LAST_KEY_LISTENER), null, null ));
 
     registerInterestListAll();
-    VM3.invoke(DeltaPropagationDUnitTest.class, "registerInterestListAll");
+    VM3.invoke(() -> DeltaPropagationDUnitTest.registerInterestListAll());
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
-    VM0.invoke(DeltaPropagationDUnitTest.class, "createAndUpdateDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
+    VM0.invoke(() -> DeltaPropagationDUnitTest.createAndUpdateDeltas());
 
     waitForLastKey();
-    VM3.invoke(DeltaPropagationDUnitTest.class, "waitForLastKey");
+    VM3.invoke(() -> DeltaPropagationDUnitTest.waitForLastKey());
 
     // TODO: (Amogh) use CCPStats.
     assertTrue("Delta Propagation feature used.", DeltaTestImpl
         .getFromDeltaInvokations().longValue() == 0);
-    long fromDeltaInvocations = (Long)VM3.invoke(DeltaTestImpl.class, "getFromDeltaInvokations");
+    long fromDeltaInvocations = (Long)VM3.invoke(() -> DeltaTestImpl.getFromDeltaInvokations());
     assertTrue("Expected " + (EVENTS_SIZE - 1) + " fromDelta() invocations but found " + "",
         (fromDeltaInvocations == (EVENTS_SIZE - 1)));
   }
 
   public void testS2CDeltaPropagationWithOnlyCreateEvents() throws Exception {
-    PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache",
-        new Object[] { HARegionQueue.HA_EVICTION_POLICY_MEMORY })).intValue();
+    PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
     createClientCache(new Integer(PORT1), new Integer(-1), "0", new Integer(
         LAST_KEY_LISTENER));
     registerInterestListAll();
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "createDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.createDeltas());
     waitForLastKey();
 
-    assertTrue("Delta Propagation feature used.", ((Long)VM0.invoke(
-        DeltaTestImpl.class, "getToDeltaInvokations")).longValue() == 0);
+    assertTrue("Delta Propagation feature used.", ((Long)VM0.invoke(() -> DeltaTestImpl.getToDeltaInvokations())).longValue() == 0);
     assertTrue("Delta Propagation feature used.", DeltaTestImpl
         .getFromDeltaInvokations().longValue() == 0);
   }
@@ -496,20 +471,18 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
    */
   public void testC2S2SDeltaPropagation() throws Exception {
     prepareDeltas();
-    VM0.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
-    VM1.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
+    VM1.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
 
     DeltaTestImpl val = deltaPut[1];
-    VM0.invoke(DeltaPropagationDUnitTest.class, "closeCache");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.closeCache());
 
-    PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache", new Object[] {
+    PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache(
             HARegionQueue.HA_EVICTION_POLICY_MEMORY, new Integer(1),
-            new Integer(C2S2S_SERVER_LISTENER) })).intValue();
-    PORT2 = ((Integer)VM1.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache", new Object[] {
+            new Integer(C2S2S_SERVER_LISTENER) ))).intValue();
+    PORT2 = ((Integer)VM1.invoke(() -> DeltaPropagationDUnitTest.createServerCache(
             HARegionQueue.HA_EVICTION_POLICY_MEMORY, new Integer(1),
-            new Integer(C2S2S_SERVER_LISTENER) })).intValue();
+            new Integer(C2S2S_SERVER_LISTENER) ))).intValue();
 
     createClientCache(new Integer(PORT1), new Integer(-1), "0", new Integer(
         NO_LISTENER));
@@ -520,51 +493,45 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
     r.create(DELTA_KEY, deltaPut[0]);
 
     // Invalidate the value at both the servers.
-    VM0.invoke(DeltaPropagationDUnitTest.class, "doLocalOp", new Object[] {
-        INVALIDATE, regionName, DELTA_KEY });
-    VM1.invoke(DeltaPropagationDUnitTest.class, "doLocalOp", new Object[] {
-        INVALIDATE, regionName, DELTA_KEY });
+    VM0.invoke(() -> DeltaPropagationDUnitTest.doLocalOp(
+        INVALIDATE, regionName, DELTA_KEY ));
+    VM1.invoke(() -> DeltaPropagationDUnitTest.doLocalOp(
+        INVALIDATE, regionName, DELTA_KEY ));
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "assertOp", new Object[] {
-        INVALIDATE, new Integer(1) });
-    VM1.invoke(DeltaPropagationDUnitTest.class, "assertOp", new Object[] {
-        INVALIDATE, new Integer(1) });
+    VM0.invoke(() -> DeltaPropagationDUnitTest.assertOp(
+        INVALIDATE, new Integer(1) ));
+    VM1.invoke(() -> DeltaPropagationDUnitTest.assertOp(
+        INVALIDATE, new Integer(1) ));
 
     r.put(DELTA_KEY, val);
     Thread.sleep(5000);
 
     // Assert that VM0 distributed val as full value to VM1.
-    VM1.invoke(DeltaPropagationDUnitTest.class, "assertValue", new Object[] {
-        regionName, DELTA_KEY, val });
+    VM1.invoke(() -> DeltaPropagationDUnitTest.assertValue(
+        regionName, DELTA_KEY, val ));
 
-    assertTrue("Delta Propagation feature used.", !((Boolean)VM0.invoke(
-        DeltaTestImpl.class, "deltaFeatureUsed")).booleanValue());
-    assertTrue("Delta Propagation feature used.", !((Boolean)VM1.invoke(
-        DeltaTestImpl.class, "deltaFeatureUsed")).booleanValue());
+    assertTrue("Delta Propagation feature used.", !((Boolean)VM0.invoke(() -> DeltaTestImpl.deltaFeatureUsed())).booleanValue());
+    assertTrue("Delta Propagation feature used.", !((Boolean)VM1.invoke(() -> DeltaTestImpl.deltaFeatureUsed())).booleanValue());
     assertTrue("Delta Propagation feature NOT used.", DeltaTestImpl
         .deltaFeatureUsed());
   }
 
   public void testS2S2CDeltaPropagationWithHAOverflow() throws Exception {
     prepareDeltas();
-    VM0.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
-    VM1.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
+    VM1.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "closeCache");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.closeCache());
 
-    PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache", new Object[] {
-            HARegionQueue.HA_EVICTION_POLICY_NONE, new Integer(1) }))
+    PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache(
+            HARegionQueue.HA_EVICTION_POLICY_NONE, new Integer(1) )))
         .intValue();
-    PORT2 = ((Integer)VM1.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache", new Object[] {
-            HARegionQueue.HA_EVICTION_POLICY_ENTRY, new Integer(1) }))
+    PORT2 = ((Integer)VM1.invoke(() -> DeltaPropagationDUnitTest.createServerCache(
+            HARegionQueue.HA_EVICTION_POLICY_ENTRY, new Integer(1) )))
         .intValue();
 
-    VM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-        new Object[] { "60000" });
-    VM1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-        new Object[] { "60000" });
+    VM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "60000" ));
+    VM1.invoke(() -> ConflationDUnitTest.setIsSlowStart( "60000" ));
 
     createClientCache(new Integer(PORT2), new Integer(-1), "0", new Integer(
         CLIENT_LISTENER));
@@ -573,20 +540,16 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
     assertNotNull(r);
     r.registerInterest("ALL_KEYS");
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "createAndUpdateDeltas");
-    VM1.invoke(DeltaPropagationDUnitTest.class, "confirmEviction",
-        new Object[] { new Integer(PORT2) });
+    VM0.invoke(() -> DeltaPropagationDUnitTest.createAndUpdateDeltas());
+    VM1.invoke(() -> DeltaPropagationDUnitTest.confirmEviction( new Integer(PORT2) ));
 
-    VM1.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
+    VM1.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
 
     waitForLastKey();
 
-    long toDeltasOnServer1 = ((Long)VM0.invoke(DeltaTestImpl.class,
-        "getToDeltaInvokations")).longValue();
-    long fromDeltasOnServer2 = ((Long)VM1.invoke(DeltaTestImpl.class,
-        "getFromDeltaInvokations")).longValue();
-    long toDeltasOnServer2 = ((Long)VM1.invoke(DeltaTestImpl.class,
-        "getToDeltaInvokations")).longValue();
+    long toDeltasOnServer1 = ((Long)VM0.invoke(() -> DeltaTestImpl.getToDeltaInvokations())).longValue();
+    long fromDeltasOnServer2 = ((Long)VM1.invoke(() -> DeltaTestImpl.getFromDeltaInvokations())).longValue();
+    long toDeltasOnServer2 = ((Long)VM1.invoke(() -> DeltaTestImpl.getToDeltaInvokations())).longValue();
     long fromDeltasOnClient = DeltaTestImpl.getFromDeltaInvokations()
         .longValue();
 
@@ -602,33 +565,27 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
 
   public void testS2CDeltaPropagationWithGIIAndFailover() throws Exception {
     prepareDeltas();
-    VM0.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
-    VM1.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
-    VM2.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
+    VM1.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
+    VM2.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
 
-    VM0.invoke(DeltaPropagationDUnitTest.class, "closeCache");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.closeCache());
 
-    PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache", new Object[] {
+    PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache(
             HARegionQueue.HA_EVICTION_POLICY_NONE, new Integer(1),
-            new Integer(NO_LISTENER) })).intValue();
-    PORT2 = ((Integer)VM1.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache", new Object[] {
+            new Integer(NO_LISTENER) ))).intValue();
+    PORT2 = ((Integer)VM1.invoke(() -> DeltaPropagationDUnitTest.createServerCache(
             HARegionQueue.HA_EVICTION_POLICY_NONE, new Integer(1),
-            new Integer(NO_LISTENER) })).intValue();
-    int port3 = ((Integer)VM2.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache", new Object[] {
+            new Integer(NO_LISTENER) ))).intValue();
+    int port3 = ((Integer)VM2.invoke(() -> DeltaPropagationDUnitTest.createServerCache(
             HARegionQueue.HA_EVICTION_POLICY_NONE, new Integer(1),
-            new Integer(NO_LISTENER) })).intValue();
+            new Integer(NO_LISTENER) ))).intValue();
 
     // Do puts after slowing the dispatcher.
     try {
-      VM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-          new Object[] { "60000" });
-      VM1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-          new Object[] { "60000" });
-      VM2.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-          new Object[] { "60000" });
+      VM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "60000" ));
+      VM1.invoke(() -> ConflationDUnitTest.setIsSlowStart( "60000" ));
+      VM2.invoke(() -> ConflationDUnitTest.setIsSlowStart( "60000" ));
   
       createClientCache(new int[] { PORT1, PORT2, port3 }, "1",
           DistributionConfig.CLIENT_CONFLATION_PROP_VALUE_DEFAULT, new Integer(
@@ -640,20 +597,20 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
       VM primary = (((PoolImpl)pool).getPrimaryPort() == PORT1) ? VM0
           : ((((PoolImpl)pool).getPrimaryPort() == PORT2) ? VM1 : VM2);
   
-      primary.invoke(DeltaPropagationDUnitTest.class, "createAndUpdateDeltas");
+      primary.invoke(() -> DeltaPropagationDUnitTest.createAndUpdateDeltas());
       Thread.sleep(5000);
   
-      primary.invoke(DeltaPropagationDUnitTest.class, "closeCache");
+      primary.invoke(() -> DeltaPropagationDUnitTest.closeCache());
       Thread.sleep(5000);
   
       primary = (((PoolImpl)pool).getPrimaryPort() == PORT1) ? VM0
           : ((((PoolImpl)pool).getPrimaryPort() == PORT2) ? VM1 : VM2);
 
-      VM0.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
-      VM1.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
-      VM2.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
+      VM0.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
+      VM1.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
+      VM2.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
 
-      primary.invoke(DeltaPropagationDUnitTest.class, "closeCache");
+      primary.invoke(() -> DeltaPropagationDUnitTest.closeCache());
       Thread.sleep(5000);
   
       primary = (((PoolImpl)pool).getPrimaryPort() == PORT1) ? VM0
@@ -668,16 +625,14 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
           + fromDeltasOnClient, fromDeltasOnClient == (EVENTS_SIZE - 1));
     }
     finally {
-      VM0.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
-      VM1.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
-      VM2.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
+      VM0.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
+      VM1.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
+      VM2.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
     }
   }
 
   public void testBug40165ClientReconnects() throws Exception {
-    PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache",
-        new Object[] { HARegionQueue.HA_EVICTION_POLICY_MEMORY })).intValue();
+    PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
     /**
      * 1. Create a cache server with slow dispatcher
@@ -694,12 +649,11 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
 
     // Step 0
     prepareDeltas();
-    VM0.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
 
     // Step 1
     try {
-      VM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-          new Object[] { "60000" });
+      VM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "60000" ));
   
       // Step 2
       String durableClientId = getName() + "_client";
@@ -719,10 +673,10 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
           regionName, properties, new Integer(DURABLE_CLIENT_LISTENER), Boolean.TRUE);
   
       // Step 3
-      VM0.invoke(DeltaPropagationDUnitTest.class, "doPuts");
+      VM0.invoke(() -> DeltaPropagationDUnitTest.doPuts());
 
       // Step 4
-      VM0.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
+      VM0.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
 
       // Step 5
       //verifyDurableClientDisconnected();
@@ -742,15 +696,13 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
           + fromDeltasOnClient, fromDeltasOnClient < 1);
     } finally {
       // Step 4
-      VM0.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
+      VM0.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
     }
 
   }
 
   public void testBug40165ClientFailsOver() throws Exception {
-    PORT1 = ((Integer)VM0.invoke(DeltaPropagationDUnitTest.class,
-        "createServerCache",
-        new Object[] { HARegionQueue.HA_EVICTION_POLICY_MEMORY })).intValue();
+    PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
     /**
      * 1. Create two cache servers with slow dispatcher
@@ -765,18 +717,14 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
 
     // Step 0
     prepareDeltas();
-    VM0.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
-    VM1.invoke(DeltaPropagationDUnitTest.class, "prepareDeltas");
+    VM0.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
+    VM1.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
 
     try {
       // Step 1
-      VM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-          new Object[] { "60000" });
-      PORT2 = ((Integer)VM1.invoke(DeltaPropagationDUnitTest.class,
-          "createServerCache",
-          new Object[] { HARegionQueue.HA_EVICTION_POLICY_MEMORY })).intValue();
-      VM1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
-          new Object[] { "60000" });
+      VM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "60000" ));
+      PORT2 = ((Integer)VM1.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
+      VM1.invoke(() -> ConflationDUnitTest.setIsSlowStart( "60000" ));
   
       // Step 2
       String durableClientId = getName() + "_client";
@@ -798,11 +746,11 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
           regionName, properties, new Integer(DURABLE_CLIENT_LISTENER), Boolean.FALSE);
   
       // Step 3
-      VM0.invoke(DeltaPropagationDUnitTest.class, "doPuts");
+      VM0.invoke(() -> DeltaPropagationDUnitTest.doPuts());
     } finally {
       // Step 4
-      VM0.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
-      VM1.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
+      VM0.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
+      VM1.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
     }
 
     // Step 5
@@ -812,7 +760,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
     }
 
     // Step 6
-    pVM.invoke(DeltaPropagationDUnitTest.class, "closeCache");
+    pVM.invoke(() -> DeltaPropagationDUnitTest.closeCache());
     Thread.sleep(5000);
     
     // Step 7

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java
index 8c249be..f383199 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java
@@ -97,15 +97,15 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
   @Override
   protected final void preTearDown() throws Exception {
     lastKeyReceived = false;
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "resetLastKeyReceived");
-    vm1.invoke(DeltaPropagationStatsDUnitTest.class, "resetLastKeyReceived");
-    vm2.invoke(DeltaPropagationStatsDUnitTest.class, "resetLastKeyReceived");
-    vm3.invoke(DeltaPropagationStatsDUnitTest.class, "resetLastKeyReceived");
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.resetLastKeyReceived());
+    vm1.invoke(() -> DeltaPropagationStatsDUnitTest.resetLastKeyReceived());
+    vm2.invoke(() -> DeltaPropagationStatsDUnitTest.resetLastKeyReceived());
+    vm3.invoke(() -> DeltaPropagationStatsDUnitTest.resetLastKeyReceived());
     closeCache();
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "closeCache");
-    vm1.invoke(DeltaPropagationStatsDUnitTest.class, "closeCache");
-    vm2.invoke(DeltaPropagationStatsDUnitTest.class, "closeCache");
-    vm3.invoke(DeltaPropagationStatsDUnitTest.class, "closeCache");
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.closeCache());
+    vm1.invoke(() -> DeltaPropagationStatsDUnitTest.closeCache());
+    vm2.invoke(() -> DeltaPropagationStatsDUnitTest.closeCache());
+    vm3.invoke(() -> DeltaPropagationStatsDUnitTest.closeCache());
   }
 
   public static void resetLastKeyReceived() {
@@ -134,15 +134,13 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
 
     createClientCache(NetworkUtils.getServerHostName(vm0.getHost()), port);
 
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "putCleanDelta",
-        new Object[] {Integer.valueOf(numOfKeys), Long.valueOf(updates)});
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "putLastKey");
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.putCleanDelta(Integer.valueOf(numOfKeys), Long.valueOf(updates)));
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.putLastKey());
 
     waitForLastKey();
 
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "verifyDeltaSenderStats",
-        new Object[] {Integer.valueOf(SERVER_TO_CLIENT),
-            Long.valueOf(numOfKeys * updates)});
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.verifyDeltaSenderStats(Integer.valueOf(SERVER_TO_CLIENT),
+            Long.valueOf(numOfKeys * updates)));
     verifyDeltaReceiverStats(SERVER_TO_CLIENT, numOfKeys * updates, 0L);
   }
 
@@ -162,19 +160,16 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
 
     createClientCache(NetworkUtils.getServerHostName(vm0.getHost()), port);
 
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class,
-        "putErrorDeltaForReceiver", new Object[] {Integer.valueOf(numOfKeys),
-            Long.valueOf(updates), Long.valueOf(errors)});
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "putErrorDeltaForSender",
-        new Object[] {Integer.valueOf(numOfKeys), Long.valueOf(updates),
-            Long.valueOf(errors2), Boolean.FALSE});
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "putLastKey");
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.putErrorDeltaForReceiver(Integer.valueOf(numOfKeys),
+            Long.valueOf(updates), Long.valueOf(errors)));
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.putErrorDeltaForSender(Integer.valueOf(numOfKeys), Long.valueOf(updates),
+            Long.valueOf(errors2), Boolean.FALSE));
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.putLastKey());
 
     waitForLastKey();
 
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "verifyDeltaSenderStats",
-        new Object[] {Integer.valueOf(SERVER_TO_CLIENT),
-            Long.valueOf(2 * numOfKeys * updates - errors2)});
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.verifyDeltaSenderStats(Integer.valueOf(SERVER_TO_CLIENT),
+            Long.valueOf(2 * numOfKeys * updates - errors2)));
     verifyDeltaReceiverStats(SERVER_TO_CLIENT, 2 * numOfKeys * updates - errors
         - errors2, errors);
   }
@@ -201,22 +196,18 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
     vm1.invoke(DeltaPropagationStatsDUnitTest.class, "createServerCache", args);
     vm2.invoke(DeltaPropagationStatsDUnitTest.class, "createServerCache", args);
     // Only delta should get sent to vm1 and vm2
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "putCleanDelta",
-        new Object[] {Integer.valueOf(numOfKeys), Long.valueOf(updates)});
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "putLastKey");
-
-    vm1.invoke(DeltaPropagationStatsDUnitTest.class, "waitForLastKey");
-    vm2.invoke(DeltaPropagationStatsDUnitTest.class, "waitForLastKey");
-
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "verifyDeltaSenderStats",
-        new Object[] {Integer.valueOf(PEER_TO_PEER),
-            Long.valueOf(numOfKeys * updates)});
-    vm1.invoke(DeltaPropagationStatsDUnitTest.class,
-        "verifyDeltaReceiverStats", new Object[] {Integer.valueOf(PEER_TO_PEER),
-            Long.valueOf(numOfKeys * updates), Long.valueOf(0)});
-    vm2.invoke(DeltaPropagationStatsDUnitTest.class,
-        "verifyDeltaReceiverStats", new Object[] {Integer.valueOf(PEER_TO_PEER),
-            Long.valueOf(numOfKeys * updates), Long.valueOf(0)});
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.putCleanDelta(Integer.valueOf(numOfKeys), Long.valueOf(updates)));
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.putLastKey());
+
+    vm1.invoke(() -> DeltaPropagationStatsDUnitTest.waitForLastKey());
+    vm2.invoke(() -> DeltaPropagationStatsDUnitTest.waitForLastKey());
+
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.verifyDeltaSenderStats(Integer.valueOf(PEER_TO_PEER),
+            Long.valueOf(numOfKeys * updates)));
+    vm1.invoke(() -> DeltaPropagationStatsDUnitTest.verifyDeltaReceiverStats(Integer.valueOf(PEER_TO_PEER),
+            Long.valueOf(numOfKeys * updates), Long.valueOf(0)));
+    vm2.invoke(() -> DeltaPropagationStatsDUnitTest.verifyDeltaReceiverStats(Integer.valueOf(PEER_TO_PEER),
+            Long.valueOf(numOfKeys * updates), Long.valueOf(0)));
   }
 
   /**
@@ -234,30 +225,25 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
     vm1.invoke(DeltaPropagationStatsDUnitTest.class, "createServerCache", args);
     vm2.invoke(DeltaPropagationStatsDUnitTest.class, "createServerCache", args);
     // Only delta should get sent to vm1 and vm2
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class,
-        "putErrorDeltaForReceiver", new Object[] {Integer.valueOf(numOfKeys),
-            Long.valueOf(updates), Long.valueOf(errors)});
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "putErrorDeltaForSender",
-        new Object[] {Integer.valueOf(numOfkeys2), Long.valueOf(updates2),
-            Long.valueOf(errors2), Boolean.FALSE});
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "putLastKey");
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.putErrorDeltaForReceiver(Integer.valueOf(numOfKeys),
+            Long.valueOf(updates), Long.valueOf(errors)));
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.putErrorDeltaForSender(Integer.valueOf(numOfkeys2), Long.valueOf(updates2),
+            Long.valueOf(errors2), Boolean.FALSE));
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.putLastKey());
 
-    vm1.invoke(DeltaPropagationStatsDUnitTest.class, "waitForLastKey");
-    vm2.invoke(DeltaPropagationStatsDUnitTest.class, "waitForLastKey");
+    vm1.invoke(() -> DeltaPropagationStatsDUnitTest.waitForLastKey());
+    vm2.invoke(() -> DeltaPropagationStatsDUnitTest.waitForLastKey());
 
     long deltasSent = (numOfKeys * updates) + (numOfkeys2 * updates2) - errors2;
     long deltasProcessed = deltasSent - errors;
 
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "verifyDeltaSenderStats",
-        new Object[] {Integer.valueOf(PEER_TO_PEER), Long.valueOf(deltasSent)});
-    vm1.invoke(DeltaPropagationStatsDUnitTest.class,
-        "verifyDeltaReceiverStats", new Object[] {
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.verifyDeltaSenderStats(Integer.valueOf(PEER_TO_PEER), Long.valueOf(deltasSent)));
+    vm1.invoke(() -> DeltaPropagationStatsDUnitTest.verifyDeltaReceiverStats(
             Integer.valueOf(PEER_TO_PEER), Long.valueOf(deltasProcessed),
-            Long.valueOf(errors)});
-    vm2.invoke(DeltaPropagationStatsDUnitTest.class,
-        "verifyDeltaReceiverStats", new Object[] {
+            Long.valueOf(errors)));
+    vm2.invoke(() -> DeltaPropagationStatsDUnitTest.verifyDeltaReceiverStats(
             Integer.valueOf(PEER_TO_PEER), Long.valueOf(deltasProcessed),
-            Long.valueOf(errors)});
+            Long.valueOf(errors)));
   }
 
   /**
@@ -286,21 +272,18 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
     putCleanDelta(numOfKeys, updates);
     putLastKey();
 
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "waitForLastKey");
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.waitForLastKey());
 
     verifyDeltaSenderStats(CLIENT_TO_SERVER, numOfKeys * updates);
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class,
-        "verifyDeltaReceiverStats", new Object[] {
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.verifyDeltaReceiverStats(
             Integer.valueOf(CLIENT_TO_SERVER),
-            Long.valueOf(numOfKeys * updates), Long.valueOf(0)});
+            Long.valueOf(numOfKeys * updates), Long.valueOf(0)));
 
     // Unrelated to Delta feature. Piggy-backing on existing test code
     // to validate fix for #49539.
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "doPuts",
-        new Object[] { numOfKeys });
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.doPuts( numOfKeys ));
     long clientOriginatedEvents = numOfKeys * updates + numOfKeys + 1;
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "verifyCCPStatsBug49539",
-        new Object[] { clientOriginatedEvents });
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.verifyCCPStatsBug49539( clientOriginatedEvents ));
   }
 
   /**
@@ -326,13 +309,12 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
     long deltasSent = 2 * (numOfKeys * updates) - errors2;
     long deltasProcessed = deltasSent - errors;
 
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class, "waitForLastKey");
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.waitForLastKey());
 
     verifyDeltaSenderStats(CLIENT_TO_SERVER, deltasSent);
-    vm0.invoke(DeltaPropagationStatsDUnitTest.class,
-        "verifyDeltaReceiverStats", new Object[] {
+    vm0.invoke(() -> DeltaPropagationStatsDUnitTest.verifyDeltaReceiverStats(
             Integer.valueOf(CLIENT_TO_SERVER), Long.valueOf(deltasProcessed),
-            Long.valueOf(errors)});
+            Long.valueOf(errors)));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegByteArrayDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegByteArrayDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegByteArrayDUnitTest.java
index f42c020..a49dbec 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegByteArrayDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegByteArrayDUnitTest.java
@@ -85,8 +85,8 @@ public class DiskRegByteArrayDUnitTest extends CacheTestCase {
       Host host = Host.getHost(0);
       VM vm0 = host.getVM(0);
       VM vm1 = host.getVM(1);
-      vm0.invoke(DiskRegByteArrayDUnitTest.class, "createCacheForVM0");
-      vm1.invoke(DiskRegByteArrayDUnitTest.class, "createCacheForVM1");
+      vm0.invoke(() -> DiskRegByteArrayDUnitTest.createCacheForVM0());
+      vm1.invoke(() -> DiskRegByteArrayDUnitTest.createCacheForVM1());
      }
     
     @Override
@@ -99,10 +99,10 @@ public class DiskRegByteArrayDUnitTest extends CacheTestCase {
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);
-        vm0.invoke(DiskRegByteArrayDUnitTest.class, "deleteFiles");
-        vm1.invoke(DiskRegByteArrayDUnitTest.class, "deleteFiles");
-        vm0.invoke(DiskRegByteArrayDUnitTest.class, "closeCache");
-        vm1.invoke(DiskRegByteArrayDUnitTest.class, "closeCache");
+        vm0.invoke(() -> DiskRegByteArrayDUnitTest.deleteFiles());
+        vm1.invoke(() -> DiskRegByteArrayDUnitTest.deleteFiles());
+        vm0.invoke(() -> DiskRegByteArrayDUnitTest.closeCache());
+        vm1.invoke(() -> DiskRegByteArrayDUnitTest.closeCache());
     }*/
     
     public static void createCacheForVM0(){
@@ -170,7 +170,7 @@ public class DiskRegByteArrayDUnitTest extends CacheTestCase {
        //Put in vm0 
        vm0.invoke(DiskRegByteArrayDUnitTest.class, "putMethod", objArr);
        //forceflush data to disk
-        vm1.invoke(DiskRegByteArrayDUnitTest.class, "flushMethod");
+        vm1.invoke(() -> DiskRegByteArrayDUnitTest.flushMethod());
       /* get the val from disk
        * verify that the value retrieved from disk represents a byte[]
        * 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java
index 4c46a55..99abf49 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java
@@ -80,8 +80,7 @@ public abstract class DistributedCacheTestCase
 
       for (int v = 0; v < host.getVMCount(); v++) {
         VM vm = host.getVM(v);
-        vm.invoke(this.getClass(), "remoteCreateCache",
-                  new Object[] {});
+        vm.invoke(() -> this.remoteCreateCache());
       }
     }
   }
@@ -129,7 +128,7 @@ public abstract class DistributedCacheTestCase
       for (int v = 0; v < host.getVMCount(); v++) {
         VM vm = host.getVM(v);
         boolean exceptionInThreads = 
-          vm.invokeBoolean(this.getClass(), "remoteCloseCache");
+          vm.invoke(() -> this.remoteCloseCache());
         if (exceptionInThreads) {
           String s = "An exception occurred in GemFire system";
           problems.append(s);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java
index 09fc882..5fbc537 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java
@@ -160,7 +160,7 @@ public class EventTrackerDUnitTest extends CacheTestCase {
     });
     
     // Create Create Region in the client
-    final int port = serverVM.invokeInt(EventTrackerDUnitTest.class, "getCacheServerPort");
+    final int port = serverVM.invoke(() -> EventTrackerDUnitTest.getCacheServerPort());
     final String hostName = NetworkUtils.getServerHostName(host);
     clientVM.invoke(new CacheSerializableRunnable("Create client") {
       public void run2() throws CacheException {
@@ -233,7 +233,7 @@ public class EventTrackerDUnitTest extends CacheTestCase {
     });
     
     // Create Create Region in the client
-    final int port = serverVM.invokeInt(EventTrackerDUnitTest.class, "getCacheServerPort");
+    final int port = serverVM.invoke(() -> EventTrackerDUnitTest.getCacheServerPort());
     final String hostName = NetworkUtils.getServerHostName(host);
     clientVM.invoke(new CacheSerializableRunnable("Create client") {
       public void run2() throws CacheException {
@@ -311,7 +311,7 @@ public class EventTrackerDUnitTest extends CacheTestCase {
     vm1.invoke(createRegion);
     
  // Create Create Region in the client
-    final int port = vm0.invokeInt(EventTrackerDUnitTest.class, "getCacheServerPort");
+    final int port = vm0.invoke(() -> EventTrackerDUnitTest.getCacheServerPort());
     final String hostName = NetworkUtils.getServerHostName(host);
     vm2.invoke(new CacheSerializableRunnable("Create client") {
       public void run2() throws CacheException {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
index a31e1e7..819afdf 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
@@ -504,11 +504,9 @@ public class EvictionStatsDUnitTest extends CacheTestCase {
     final long ONE_MEG = 1024L * 1024L;
     long sizeOfPR = 0;
     sizeOfPR = sizeOfPR
-        + (Long)dataStore1.invoke(EvictionStatsDUnitTest.class,
-            "getPartionRegionCounter", new Object[] { prRegionName });
+        + (Long)dataStore1.invoke(() -> EvictionStatsDUnitTest.getPartionRegionCounter( prRegionName ));
     sizeOfPR = sizeOfPR
-        + (Long)dataStore2.invoke(EvictionStatsDUnitTest.class,
-            "getPartionRegionCounter", new Object[] { prRegionName });
+        + (Long)dataStore2.invoke(() -> EvictionStatsDUnitTest.getPartionRegionCounter( prRegionName ));
     return sizeOfPR / ONE_MEG;
   }
 
@@ -523,11 +521,9 @@ public class EvictionStatsDUnitTest extends CacheTestCase {
     final long ONE_MEG = 1024L * 1024L;
     long totalBucketSize = 0;
     totalBucketSize = totalBucketSize
-        + (Long)dataStore1.invoke(EvictionStatsDUnitTest.class,
-            "getCounterForBuckets", new Object[] { prRegionName });
+        + (Long)dataStore1.invoke(() -> EvictionStatsDUnitTest.getCounterForBuckets( prRegionName ));
     totalBucketSize = totalBucketSize
-        + (Long)dataStore2.invoke(EvictionStatsDUnitTest.class,
-            "getCounterForBuckets", new Object[] { prRegionName });
+        + (Long)dataStore2.invoke(() -> EvictionStatsDUnitTest.getCounterForBuckets( prRegionName ));
     return totalBucketSize / ONE_MEG;
 
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
index 6726747..5416862 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
@@ -150,8 +150,8 @@ public class EvictionTestBase extends CacheTestCase {
       }      
     });
 
-    dataStore3.invoke(EvictionTestBase.class, "setTolerance");
-    dataStore4.invoke(EvictionTestBase.class, "setTolerance");
+    dataStore3.invoke(() -> EvictionTestBase.setTolerance());
+    dataStore4.invoke(() -> EvictionTestBase.setTolerance());
 
     dataStore3.invoke(new SerializableRunnable() {
       @Override
@@ -508,7 +508,7 @@ public class EvictionTestBase extends CacheTestCase {
   }
 
   public void killVm() {
-    dataStore4.invoke(EvictionTestBase.class, "close");
+    dataStore4.invoke(() -> EvictionTestBase.close());
 
   }
 
@@ -543,8 +543,7 @@ public class EvictionTestBase extends CacheTestCase {
   }
 
   public int getPRSize(String string) {
-    Integer prSize = (Integer)dataStore4.invoke(EvictionTestBase.class,
-        "returnPRSize", new Object[] { string });
+    Integer prSize = (Integer)dataStore4.invoke(() -> EvictionTestBase.returnPRSize( string ));
     return prSize;
 
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java
index 86376d9..4276a60 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java
@@ -111,55 +111,45 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q2", 3));
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q3", 3));
 
-    datastoreServer.invoke(FixedPRSinglehopDUnitTest.class, "createServer",
-        new Object[] { false, fpaList });
+    datastoreServer.invoke(() -> FixedPRSinglehopDUnitTest.createServer( false, fpaList ));
 
     fpaList.clear();
-    accessorServer.invoke(FixedPRSinglehopDUnitTest.class, "createServer",
-        new Object[] { true, fpaList });
+    accessorServer.invoke(() -> FixedPRSinglehopDUnitTest.createServer( true, fpaList ));
 
     fpaList.clear();
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q2", true, 3));
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q3", true, 3));
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q4", 3));
 
-    peer1.invoke(FixedPRSinglehopDUnitTest.class, "createPeer", new Object[] {
-        false, fpaList });
+    peer1.invoke(() -> FixedPRSinglehopDUnitTest.createPeer(
+        false, fpaList ));
 
     fpaList.clear();
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q4", true, 3));
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q1", 3));
 
-    peer2.invoke(FixedPRSinglehopDUnitTest.class, "createPeer", new Object[] {
-        false, fpaList });
-
-    datastoreServer.invoke(FixedPRSinglehopDUnitTest.class,
-        "putIntoPartitionedRegions");
-    accessorServer.invoke(FixedPRSinglehopDUnitTest.class,
-        "putIntoPartitionedRegions");
-    peer1.invoke(FixedPRSinglehopDUnitTest.class, "putIntoPartitionedRegions");
-    peer2.invoke(FixedPRSinglehopDUnitTest.class, "putIntoPartitionedRegions");
-
-    datastoreServer.invoke(FixedPRSinglehopDUnitTest.class,
-        "getFromPartitionedRegions");
-    accessorServer.invoke(FixedPRSinglehopDUnitTest.class,
-        "getFromPartitionedRegions");
-    peer1.invoke(FixedPRSinglehopDUnitTest.class, "getFromPartitionedRegions");
-    peer2.invoke(FixedPRSinglehopDUnitTest.class, "getFromPartitionedRegions");
-
-    datastoreServer.invoke(FixedPRSinglehopDUnitTest.class,
-        "verifyEmptyMetadata");
-    accessorServer.invoke(FixedPRSinglehopDUnitTest.class,
-        "verifyEmptyMetadata");
-    peer1.invoke(FixedPRSinglehopDUnitTest.class, "verifyEmptyMetadata");
-    peer2.invoke(FixedPRSinglehopDUnitTest.class, "verifyEmptyMetadata");
-
-    datastoreServer.invoke(FixedPRSinglehopDUnitTest.class,
-        "verifyEmptyStaticData");
-    accessorServer.invoke(FixedPRSinglehopDUnitTest.class,
-        "verifyEmptyStaticData");
-    peer1.invoke(FixedPRSinglehopDUnitTest.class, "verifyEmptyStaticData");
-    peer2.invoke(FixedPRSinglehopDUnitTest.class, "verifyEmptyStaticData");
+    peer2.invoke(() -> FixedPRSinglehopDUnitTest.createPeer(
+        false, fpaList ));
+
+    datastoreServer.invoke(() -> FixedPRSinglehopDUnitTest.putIntoPartitionedRegions());
+    accessorServer.invoke(() -> FixedPRSinglehopDUnitTest.putIntoPartitionedRegions());
+    peer1.invoke(() -> FixedPRSinglehopDUnitTest.putIntoPartitionedRegions());
+    peer2.invoke(() -> FixedPRSinglehopDUnitTest.putIntoPartitionedRegions());
+
+    datastoreServer.invoke(() -> FixedPRSinglehopDUnitTest.getFromPartitionedRegions());
+    accessorServer.invoke(() -> FixedPRSinglehopDUnitTest.getFromPartitionedRegions());
+    peer1.invoke(() -> FixedPRSinglehopDUnitTest.getFromPartitionedRegions());
+    peer2.invoke(() -> FixedPRSinglehopDUnitTest.getFromPartitionedRegions());
+
+    datastoreServer.invoke(() -> FixedPRSinglehopDUnitTest.verifyEmptyMetadata());
+    accessorServer.invoke(() -> FixedPRSinglehopDUnitTest.verifyEmptyMetadata());
+    peer1.invoke(() -> FixedPRSinglehopDUnitTest.verifyEmptyMetadata());
+    peer2.invoke(() -> FixedPRSinglehopDUnitTest.verifyEmptyMetadata());
+
+    datastoreServer.invoke(() -> FixedPRSinglehopDUnitTest.verifyEmptyStaticData());
+    accessorServer.invoke(() -> FixedPRSinglehopDUnitTest.verifyEmptyStaticData());
+    peer1.invoke(() -> FixedPRSinglehopDUnitTest.verifyEmptyStaticData());
+    peer2.invoke(() -> FixedPRSinglehopDUnitTest.verifyEmptyStaticData());
   }
 
   // 2 AccessorServers, 2 Peers
@@ -174,25 +164,23 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
 
     List<FixedPartitionAttributes> fpaList = new ArrayList<FixedPartitionAttributes>();
 
-    Integer port0 = (Integer)accessorServer1.invoke(
-        FixedPRSinglehopDUnitTest.class, "createServer", new Object[] { true,
-            fpaList });
+    Integer port0 = (Integer)accessorServer1.invoke(() -> FixedPRSinglehopDUnitTest.createServer( true,
+            fpaList ));
 
-    Integer port1 = (Integer)accessorServer2.invoke(
-        FixedPRSinglehopDUnitTest.class, "createServer", new Object[] { true,
-            fpaList });
+    Integer port1 = (Integer)accessorServer2.invoke(() -> FixedPRSinglehopDUnitTest.createServer( true,
+            fpaList ));
 
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q4", true, 3));
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q1", true, 3));
 
-    peer1.invoke(FixedPRSinglehopDUnitTest.class, "createPeer", new Object[] {
-        false, fpaList });
+    peer1.invoke(() -> FixedPRSinglehopDUnitTest.createPeer(
+        false, fpaList ));
     fpaList.clear();
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q2", true, 3));
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q3", true, 3));
 
-    peer2.invoke(FixedPRSinglehopDUnitTest.class, "createPeer", new Object[] {
-        false, fpaList });
+    peer2.invoke(() -> FixedPRSinglehopDUnitTest.createPeer(
+        false, fpaList ));
 
     createClient(port0, port1);
 
@@ -221,30 +209,26 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q1", true, 3));
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q2", false, 3));
 
-    Integer port1 = (Integer)server1.invoke(
-        FixedPRSinglehopDUnitTest.class, "createServer", new Object[] { false,
-            fpaList });
+    Integer port1 = (Integer)server1.invoke(() -> FixedPRSinglehopDUnitTest.createServer( false,
+            fpaList ));
     fpaList.clear();
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q3", true, 3));
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q4", false, 3));
 
-    Integer port2 = (Integer)server2.invoke(
-        FixedPRSinglehopDUnitTest.class, "createServer", new Object[] { false,
-            fpaList });
+    Integer port2 = (Integer)server2.invoke(() -> FixedPRSinglehopDUnitTest.createServer( false,
+            fpaList ));
     fpaList.clear();
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q2", true, 3));
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q3", false, 3));
     
-    Integer port3 = (Integer)server3.invoke(
-        FixedPRSinglehopDUnitTest.class, "createServer", new Object[] { false,
-            fpaList });
+    Integer port3 = (Integer)server3.invoke(() -> FixedPRSinglehopDUnitTest.createServer( false,
+            fpaList ));
     fpaList.clear();
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q4", true, 3));
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q1", false, 3));
     
-    Integer port4 = (Integer)server4.invoke(
-        FixedPRSinglehopDUnitTest.class, "createServer", new Object[] { false,
-            fpaList });    
+    Integer port4 = (Integer)server4.invoke(() -> FixedPRSinglehopDUnitTest.createServer( false,
+            fpaList ));    
 
     createClient(port1, port2, port3, port4);
 
@@ -252,16 +236,16 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
 
     getFromPartitionedRegions();
 
-    server1.invoke(FixedPRSinglehopDUnitTest.class, "printView");
-    server2.invoke(FixedPRSinglehopDUnitTest.class, "printView");
-    server3.invoke(FixedPRSinglehopDUnitTest.class, "printView");
-    server4.invoke(FixedPRSinglehopDUnitTest.class, "printView");
+    server1.invoke(() -> FixedPRSinglehopDUnitTest.printView());
+    server2.invoke(() -> FixedPRSinglehopDUnitTest.printView());
+    server3.invoke(() -> FixedPRSinglehopDUnitTest.printView());
+    server4.invoke(() -> FixedPRSinglehopDUnitTest.printView());
     
     int totalBucketOnServer = 0;
-    totalBucketOnServer += (Integer)server1.invoke(FixedPRSinglehopDUnitTest.class, "totalNumBucketsCreated");
-    totalBucketOnServer += (Integer)server2.invoke(FixedPRSinglehopDUnitTest.class, "totalNumBucketsCreated");
-    totalBucketOnServer += (Integer)server3.invoke(FixedPRSinglehopDUnitTest.class, "totalNumBucketsCreated");
-    totalBucketOnServer += (Integer)server4.invoke(FixedPRSinglehopDUnitTest.class, "totalNumBucketsCreated");
+    totalBucketOnServer += (Integer)server1.invoke(() -> FixedPRSinglehopDUnitTest.totalNumBucketsCreated());
+    totalBucketOnServer += (Integer)server2.invoke(() -> FixedPRSinglehopDUnitTest.totalNumBucketsCreated());
+    totalBucketOnServer += (Integer)server3.invoke(() -> FixedPRSinglehopDUnitTest.totalNumBucketsCreated());
+    totalBucketOnServer += (Integer)server4.invoke(() -> FixedPRSinglehopDUnitTest.totalNumBucketsCreated());
     
     verifyMetadata(totalBucketOnServer,2);
     updateIntoSinglePR();
@@ -286,8 +270,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
     final int portLocator = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String hostLocator = NetworkUtils.getServerHostName(server1.getHost());
     final String locator = hostLocator + "[" + portLocator + "]";
-    server3.invoke(FixedPRSinglehopDUnitTest.class,
-        "startLocatorInVM", new Object[] { portLocator });
+    server3.invoke(() -> FixedPRSinglehopDUnitTest.startLocatorInVM( portLocator ));
     try {
     
     List<FixedPartitionAttributes> fpaList = new ArrayList<FixedPartitionAttributes>();
@@ -295,15 +278,13 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q1", true, 3));
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q2", false, 3));
 
-    Integer port1 = (Integer)server1.invoke(
-        FixedPRSinglehopDUnitTest.class, "createServerWithLocator", new Object[] { locator, false,
-            fpaList,  simpleFPR});
+    Integer port1 = (Integer)server1.invoke(() -> FixedPRSinglehopDUnitTest.createServerWithLocator( locator, false,
+            fpaList,  simpleFPR));
     fpaList.clear();
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q3", true, 3));
 
-    Integer port2 = (Integer)server2.invoke(
-        FixedPRSinglehopDUnitTest.class, "createServerWithLocator", new Object[] { locator, false,
-            fpaList , simpleFPR});
+    Integer port2 = (Integer)server2.invoke(() -> FixedPRSinglehopDUnitTest.createServerWithLocator( locator, false,
+            fpaList , simpleFPR));
     fpaList.clear();
     
     createClientWithLocator(hostLocator, portLocator);
@@ -313,12 +294,12 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
     getFromPartitionedRegionsFor3Qs();
     Wait.pause(2000);
     // TODO: Verify that all the fpa's are in the map
-    server1.invoke(FixedPRSinglehopDUnitTest.class, "printView");
-    server2.invoke(FixedPRSinglehopDUnitTest.class, "printView");
+    server1.invoke(() -> FixedPRSinglehopDUnitTest.printView());
+    server2.invoke(() -> FixedPRSinglehopDUnitTest.printView());
     
     int totalBucketOnServer = 0;
-    totalBucketOnServer += (Integer)server1.invoke(FixedPRSinglehopDUnitTest.class, "totalNumBucketsCreated");
-    totalBucketOnServer += (Integer)server2.invoke(FixedPRSinglehopDUnitTest.class, "totalNumBucketsCreated");
+    totalBucketOnServer += (Integer)server1.invoke(() -> FixedPRSinglehopDUnitTest.totalNumBucketsCreated());
+    totalBucketOnServer += (Integer)server2.invoke(() -> FixedPRSinglehopDUnitTest.totalNumBucketsCreated());
     int currentRedundancy = 1;
     verifyMetadata(totalBucketOnServer,currentRedundancy);
     updateIntoSinglePRFor3Qs();
@@ -330,9 +311,8 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q1", false, 3));
     fpaList.add(FixedPartitionAttributes.createFixedPartition("Q3", false, 3));
   
-    Integer port4 = (Integer)server4.invoke(
-        FixedPRSinglehopDUnitTest.class, "createServerWithLocator", new Object[] { locator, false,
-            fpaList, simpleFPR });    
+    Integer port4 = (Integer)server4.invoke(() -> FixedPRSinglehopDUnitTest.createServerWithLocator( locator, false,
+            fpaList, simpleFPR ));    
     
     Wait.pause(2000);
     putIntoPartitionedRegions();
@@ -341,18 +321,18 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
 
     getFromPartitionedRegions();
     Wait.pause(2000);
-    server1.invoke(FixedPRSinglehopDUnitTest.class, "printView");
-    server2.invoke(FixedPRSinglehopDUnitTest.class, "printView");
-    server4.invoke(FixedPRSinglehopDUnitTest.class, "printView");
+    server1.invoke(() -> FixedPRSinglehopDUnitTest.printView());
+    server2.invoke(() -> FixedPRSinglehopDUnitTest.printView());
+    server4.invoke(() -> FixedPRSinglehopDUnitTest.printView());
     
     totalBucketOnServer = 0;
-    totalBucketOnServer += (Integer)server1.invoke(FixedPRSinglehopDUnitTest.class, "totalNumBucketsCreated");
-    totalBucketOnServer += (Integer)server2.invoke(FixedPRSinglehopDUnitTest.class, "totalNumBucketsCreated");
-    totalBucketOnServer += (Integer)server4.invoke(FixedPRSinglehopDUnitTest.class, "totalNumBucketsCreated");
+    totalBucketOnServer += (Integer)server1.invoke(() -> FixedPRSinglehopDUnitTest.totalNumBucketsCreated());
+    totalBucketOnServer += (Integer)server2.invoke(() -> FixedPRSinglehopDUnitTest.totalNumBucketsCreated());
+    totalBucketOnServer += (Integer)server4.invoke(() -> FixedPRSinglehopDUnitTest.totalNumBucketsCreated());
     
     updateIntoSinglePR();
     } finally {
-    server3.invoke(FixedPRSinglehopDUnitTest.class, "stopLocator"); 
+    server3.invoke(() -> FixedPRSinglehopDUnitTest.stopLocator()); 
     }
   }
   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69024aa9/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
index 1e714f1..e8dbe56 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
@@ -110,10 +110,10 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
   
   @Override
   protected final void preTearDownCacheTestCase() throws Exception {
-    P.invoke(GIIDeltaDUnitTest.class, "resetSlowGII");
-    R.invoke(GIIDeltaDUnitTest.class, "resetSlowGII");
-    P.invoke(InitialImageOperation.class, "resetAllGIITestHooks");
-    R.invoke(InitialImageOperation.class, "resetAllGIITestHooks");
+    P.invoke(() -> GIIDeltaDUnitTest.resetSlowGII());
+    R.invoke(() -> GIIDeltaDUnitTest.resetSlowGII());
+    P.invoke(() -> InitialImageOperation.resetAllGIITestHooks());
+    R.invoke(() -> InitialImageOperation.resetAllGIITestHooks());
     changeUnfinishedOperationLimit(R, 10000);
     changeForceFullGII(R, false, false);
     changeForceFullGII(P, false, false);
@@ -201,8 +201,8 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     final DiskStoreID memberR = getMemberID(R);
     final long blocklist[] = {2,3};
     
-    P.invoke(GIIDeltaDUnitTest.class, "slowGII", new Object[] {blocklist});
-    R.invoke(GIIDeltaDUnitTest.class, "slowGII", new Object[] {blocklist});
+    P.invoke(() -> GIIDeltaDUnitTest.slowGII(blocklist));
+    R.invoke(() -> GIIDeltaDUnitTest.slowGII(blocklist));
     AsyncInvocation async1 = doOnePutAsync(P, 2, "key1");
     AsyncInvocation async2 = doOnePutAsync(R, 3, "key1");
     
@@ -213,8 +213,8 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     waitForToVerifyRVV(R, memberR, 3, null, 0); // P's rvv=r2, gc=0
     
     // new Object[] { memberP, 2, 3, 0, 0, false }
-    P.invoke(GIIDeltaDUnitTest.class, "resetSlowGII");
-    R.invoke(GIIDeltaDUnitTest.class, "resetSlowGII");
+    P.invoke(() -> GIIDeltaDUnitTest.resetSlowGII());
+    R.invoke(() -> GIIDeltaDUnitTest.resetSlowGII());
     
     // should wait for async calls to finish before going on
     checkAsyncCall(async1);
@@ -237,7 +237,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     final long[] exceptionlist = {4,5};
     
     // let r6 to succeed, r4,r5 to be blocked
-    R.invoke(GIIDeltaDUnitTest.class, "slowGII", new Object[] {exceptionlist});
+    R.invoke(() -> GIIDeltaDUnitTest.slowGII(exceptionlist));
     AsyncInvocation async1 = doOnePutAsync(R, 4, "key4");
     waitForToVerifyRVV(R, memberR, 4, null, 0); // P's rvv=r4, gc=0
     
@@ -482,7 +482,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     // 2
     waitForCallbackStarted(R, GIITestHookType.AfterRequestRVV);
     forceGC(R, 1);
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterRequestRVV, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterRequestRVV, true));
     
     async3.join(MAX_WAIT);
     
@@ -608,7 +608,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     checkIfFullGII(P, REGION_NAME, R_rvv_bytes, true);
 
     // let GII continue
-    P.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterReceivedRequestImage, true});
+    P.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterReceivedRequestImage, true));
     async3.join(MAX_WAIT);
 
     waitForToVerifyRVV(R, memberP, 7, null, 4); // R's rvv=p7, gc=4
@@ -772,7 +772,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     
     final long[] exceptionlist2 = {8};
     // let p9 to succeed, p8 to be blocked
-    P.invoke(GIIDeltaDUnitTest.class, "slowGII", new Object[] {exceptionlist2});
+    P.invoke(() -> GIIDeltaDUnitTest.slowGII(exceptionlist2));
     AsyncInvocation async1 = doOneDestroyAsync(P, 8, "key1");
     waitForToVerifyRVV(P, memberP, 8, null, 0);
     doOnePut(P, 9, "key3");
@@ -815,7 +815,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     VersionTag expect_tag = getVersionTag(R, "key5");
 
     final long[] exceptionlist = {4,5};
-    R.invoke(GIIDeltaDUnitTest.class, "slowGII", new Object[] {exceptionlist});
+    R.invoke(() -> GIIDeltaDUnitTest.slowGII(exceptionlist));
     AsyncInvocation async1 = doOnePutAsync(R, 4, "key4");
     waitForToVerifyRVV(R, memberR, 4, null, 0); // P's rvv=r4, gc=0
     
@@ -906,9 +906,9 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
 
     doOneDestroy(P, 4, "key2");
     doOnePut(P, 5, "key1");
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.BeforeSavedReceivedRVV, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.BeforeSavedReceivedRVV, true));
     waitForCallbackStarted(R, GIITestHookType.AfterSavedReceivedRVV);
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterSavedReceivedRVV, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterSavedReceivedRVV, true));
     async3.join(MAX_WAIT);
     waitForToVerifyRVV(R, memberP, 5, null, 0); // P's rvv=r5, gc=0
     changeForceFullGII(R, true, true);
@@ -959,9 +959,9 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
 
     doOneDestroy(P, 4, "key2");
     doOnePut(P, 5, "key1");
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterCalculatedUnfinishedOps, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterCalculatedUnfinishedOps, true));
     waitForCallbackStarted(R, GIITestHookType.AfterSavedReceivedRVV);
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterSavedReceivedRVV, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterSavedReceivedRVV, true));
     async3.join(MAX_WAIT);
     waitForToVerifyRVV(R, memberP, 5, null, 0); // P's rvv=r5, gc=0
     verifyDeltaSizeFromStats(R, 2, 1);
@@ -985,7 +985,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     VersionTag expect_tag = getVersionTag(R, "key5");
 
     final long[] exceptionlist = {4,5};
-    R.invoke(GIIDeltaDUnitTest.class, "slowGII", new Object[] {exceptionlist});
+    R.invoke(() -> GIIDeltaDUnitTest.slowGII(exceptionlist));
     AsyncInvocation async1 = doOnePutAsync(R, 4, "key4");
     waitForToVerifyRVV(R, memberR, 4, null, 0); // P's rvv=r4, gc=0
     
@@ -1119,46 +1119,46 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     
     // 1
     waitForCallbackStarted(R, GIITestHookType.BeforeRequestRVV);
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.BeforeRequestRVV, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.BeforeRequestRVV, true));
     // 2
     waitForCallbackStarted(R, GIITestHookType.AfterRequestRVV);
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterRequestRVV, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterRequestRVV, true));
     // 3
     waitForCallbackStarted(R, GIITestHookType.AfterCalculatedUnfinishedOps);
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterCalculatedUnfinishedOps, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterCalculatedUnfinishedOps, true));
     // 4
     waitForCallbackStarted(R, GIITestHookType.BeforeSavedReceivedRVV);
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.BeforeSavedReceivedRVV, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.BeforeSavedReceivedRVV, true));
     // 5
     waitForCallbackStarted(R, GIITestHookType.AfterSavedReceivedRVV);
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterSavedReceivedRVV, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterSavedReceivedRVV, true));
 
     // 6
     waitForCallbackStarted(R, GIITestHookType.AfterSentRequestImage);
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterSentRequestImage, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterSentRequestImage, true));
     
     // 7
     waitForCallbackStarted(P, GIITestHookType.AfterReceivedRequestImage);
-    P.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterReceivedRequestImage, true});
+    P.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterReceivedRequestImage, true));
     // 8
     waitForCallbackStarted(P, GIITestHookType.DuringPackingImage);
-    P.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.DuringPackingImage, true});
+    P.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.DuringPackingImage, true));
     // 9
     waitForCallbackStarted(P, GIITestHookType.AfterSentImageReply);
-    P.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterSentImageReply, true});
+    P.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterSentImageReply, true));
 
     // 10
     waitForCallbackStarted(R, GIITestHookType.AfterReceivedImageReply);
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterReceivedImageReply, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterReceivedImageReply, true));
     // 11
     waitForCallbackStarted(R, GIITestHookType.DuringApplyDelta);
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.DuringApplyDelta, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.DuringApplyDelta, true));
     // 12
     waitForCallbackStarted(R, GIITestHookType.BeforeCleanExpiredTombstones);
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.BeforeCleanExpiredTombstones, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.BeforeCleanExpiredTombstones, true));
     // 13
     waitForCallbackStarted(R, GIITestHookType.AfterSavedRVVEnd);
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterSavedRVVEnd, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterSavedRVVEnd, true));
     
     async3.join(MAX_WAIT);
     
@@ -1182,7 +1182,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     waitForToVerifyRVV(R, memberR, 6, exceptionlist, 0); // R's rvv=r6, gc=0
     waitForToVerifyRVV(P, memberR, 6, exceptionlist, 0); // P's rvv=r6(3-6), gc=0
     
-    P.invoke(InitialImageOperation.class, "resetAllGIITestHooks");
+    P.invoke(() -> InitialImageOperation.resetAllGIITestHooks());
   }
 
   /**
@@ -1266,8 +1266,8 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     waitForToVerifyRVV(P, memberP, 7, null, 0); // P's rvv=p7, gc=0
 
     // let GII continue
-    P.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.DuringPackingImage, false});
-    P.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.DuringPackingImage, true});
+    P.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.DuringPackingImage, false));
+    P.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.DuringPackingImage, true));
     
     WaitCriterion ev2 = new WaitCriterion() {
       public boolean done() {
@@ -1316,7 +1316,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     waitToVerifyKey(R, "key5", generateValue(R));
     VersionTag tag = getVersionTag(R, "key5");
     assertTrue(expect_tag.equals(tag));
-    //    P.invoke(InitialImageOperation.class, "resetAllGIITestHooks");
+    //    P.invoke(() -> InitialImageOperation.resetAllGIITestHooks());
   }
   
   /**
@@ -1393,7 +1393,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     forceGC(P, 3);
     
     // let GII continue
-    P.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.DuringPackingImage, true});
+    P.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.DuringPackingImage, true));
     async3.join(MAX_WAIT*2);
     count = getDeltaGIICount(P);
     assertEquals(0, count);
@@ -1581,7 +1581,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     waitForCallbackStarted(R, GIITestHookType.AfterReceivedImageReply);
     doOneClear(P, 8);
 
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterReceivedImageReply, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterReceivedImageReply, true));
     async3.getResult(MAX_WAIT);
 
     // clear() increased P's version with 1 to P8
@@ -1649,7 +1649,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     waitForCallbackStarted(R, GIITestHookType.AfterSavedReceivedRVV);
     doOneClear(P, 8);
 
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterSavedReceivedRVV, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterSavedReceivedRVV, true));
     async3.join(MAX_WAIT);
 
     // clear() increased P's version with 1 to P8
@@ -1802,7 +1802,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     // kill and restart R
     closeCache(R);
     async3.join(MAX_WAIT);
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterSavedReceivedRVV, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterSavedReceivedRVV, true));
     createDistributedRegion(R);
 
     waitForToVerifyRVV(P, memberP, 7, null, 0); // P's rvv=r8, gc=0
@@ -1868,7 +1868,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     // from P.
     doOnePut(P, 7, "key1");
     
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.BeforeSavedReceivedRVV, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.BeforeSavedReceivedRVV, true));
     
     // Wait until the new RVV is applied
     waitForCallbackStarted(R, GIITestHookType.AfterSavedReceivedRVV);
@@ -1878,7 +1878,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
     destroyRegion(P);
     
     //Allow the GII to continue.
-    R.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterSavedReceivedRVV, true});
+    R.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterSavedReceivedRVV, true));
     
     async3.join(MAX_WAIT);
     
@@ -1963,7 +1963,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
               DistributionMessage message) {
             if(message instanceof TombstoneMessage && ((TombstoneMessage) message).regionPath.contains(REGION_NAME)) {
               System.err.println("DAN DEBUG  P has processed the tombstone message, allowing R to proceed with the GII");
-              vmR.invoke(InitialImageOperation.class, "resetGIITestHook", new Object[] {GIITestHookType.AfterCalculatedUnfinishedOps, true});
+              vmR.invoke(() -> InitialImageOperation.resetGIITestHook(GIITestHookType.AfterCalculatedUnfinishedOps, true));
               DistributionMessageObserver.setInstance(null);
             }
           }


Mime
View raw message