@Test
  public void test019Create() throws EntryExistsException {
    int key = 0;
    PartitionedRegion pr = (PartitionedRegion) PartitionedRegionTestHelper
        .createPartitionedRegion("testCreate", String.valueOf(200), 0);

    // testing if the create is working fine.
    // It checks that it throws EntryExistsException for an already existing key

    final String expectedExceptions = EntryExistsException.class.getName();
    for (int num = 0; num < 3; num++) {
      key++;
      final long initialCreates = getCreateCount(pr);
      pr.create(key, val + num);
      assertEquals(initialCreates + 1, getCreateCount(pr));
      final Object getObj1 = pr.get(key);

      if (!getObj1.equals(val + num)) {
        fail("Create could not create an entry");
      }
      pr.getCache().getLogger()
          .info("<ExpectedException action=add>" + expectedExceptions + "</ExpectedException>");
      try {
        pr.create(key, val + num + "Added number");
        fail(
            "create doesnt throw EntryExistsException subsequent create on an already existing key");
      } catch (EntryExistsException ignored) {
      }
      pr.getCache().getLogger()
          .info("<ExpectedException action=remove>" + expectedExceptions + "</ExpectedException>");

      final Object getObj2 = pr.get(key);

      if (!getObj1.equals(getObj2)) {
        fail("Create could not create an entry");
      }
    }
    // I am going to null val check;

    for (int cnt = 0; cnt < 3; cnt++) {
      Object dummyObj = "DummyVal";
      Object nonNullKey = (long) cnt;
      Object nullVal = null;
      Object nonNullVal = cnt + "";
      pr.create(nonNullKey, nullVal);
      dummyObj = pr.get(nonNullKey);

      if (dummyObj != null) {
        fail("Create can not create an entry with null value");
      }
      pr.getCache().getLogger()
          .info("<ExpectedException action=add>" + expectedExceptions + "</ExpectedException>");
      try {
        pr.create(nonNullKey, nonNullVal);
        fail("Create does not throw EntryExistsException with for an existing null value as well");
      } catch (EntryExistsException ignored) {
      }
      pr.getCache().getLogger()
          .info("<ExpectedException action=remove>" + expectedExceptions + "</ExpectedException>");
    }
  }
This method validates create operations. It verfies that entries are created and if entry
already exists, it throws EntryExistsException.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionSingleNodeOperationsJUnitTest.java