private void doPut(final Object key, final Object value, final String regionName,
      final boolean expectException) {
    Region region = getCache().getRegion(regionName);
    assertThat(region).isNotNull();

    try {
      region.put(key, value);
      if (expectException) {
        fail("Expected OutOfOffHeapMemoryException");
      }
    } catch (OutOfOffHeapMemoryException e) {
      if (!expectException) {
        throw e;
      }
    }
  }
Performs a put operation.

@param key region entry key.
@param value region entry value.
@param regionName a region name.
geode-core/src/distributedTest/java/org/apache/geode/management/OffHeapManagementDUnitTest.java