public static void putErrorDeltaForSender(Integer keys, Long updates, Long errors,
      Boolean doCreate) {
    Region r = cache.getRegion(REGION_NAME);
    assertTrue("Errors cannot be more than 1/3rd of total updates", (keys * updates) / 3 > errors);

    if (doCreate) {
      for (int i = 0; i < keys; i++) {
        r.create(DELTA_KEY + i, new DeltaTestImpl());
      }
    }

    for (int i = 0; i < keys; i++) {
      for (long j = 0; j < updates; j++) {
        DeltaTestImpl delta = new DeltaTestImpl();
        if (j % 3 == 1) {
          delta.setStr("one");
        } else if (j % 3 == 2) {
          delta.setIntVar(111);
          if (errors != 0) {
            delta.setIntVar(DeltaTestImpl.ERRONEOUS_INT_FOR_TO_DELTA);
            errors--;
          }
        } else {
          delta.setByteArr(new byte[] {11, 22, 33, 44});
          delta.setDoubleVar(5.7);
        }
        try {
          r.put(DELTA_KEY + i, delta);
          assertTrue("Expected an InvalidDeltaException to be thrown, but it wasn't!",
              delta.getIntVar() != DeltaTestImpl.ERRONEOUS_INT_FOR_TO_DELTA);
        } catch (InvalidDeltaException ide) {
          assertTrue("InvalidDeltaException not expected.",
              delta.getIntVar() == DeltaTestImpl.ERRONEOUS_INT_FOR_TO_DELTA);
          cache.getLogger().fine("Received InvalidDeltaException as expected.");
        }
      }
    }
    assertTrue("Error puts not exhausted", errors == 0);
  }
Simulates old value null, entry null
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DeltaPropagationStatsDUnitTest.java