@Override
  public String toString() {
    final StringBuilder sb = new StringBuilder(MemoryBlock.class.getSimpleName());
    sb.append("{");
    sb.append("MemoryAddress=").append(getAddress());
    sb.append(", State=").append(getState());
    sb.append(", BlockSize=").append(getBlockSize());
    sb.append(", SlabId=").append(getSlabId());
    sb.append(", FreeListId=");
    if (getState() == State.UNUSED || getState() == State.ALLOCATED) {
      sb.append("NONE");
    } else if (getFreeListId() == -1) {
      sb.append("HUGE");
    } else {
      sb.append(getFreeListId());
    }
    sb.append(", RefCount=").append(getRefCount());
    sb.append(", isSerialized=").append(isSerialized());
    sb.append(", isCompressed=").append(isCompressed());
    sb.append(", DataType=").append(getDataType());
    {
      sb.append(", DataValue=");
      Object dataValue = getDataValue();
      if (dataValue instanceof byte[]) {
        byte[] ba = (byte[]) dataValue;
        if (ba.length < 1024) {
          sb.append(Arrays.toString(ba));
        } else {
          sb.append("<byte array of length " + ba.length + ">");
        }
      } else {
        sb.append(dataValue);
      }
    }
    sb.append("}");
    return sb.toString();
  }
Basic implementation of MemoryBlock for test validation only.
geode-core/src/main/java/org/apache/geode/internal/offheap/MemoryBlockNode.java