@VisibleForTesting
  public static int getStartSize(int numArrays, int avgArrayLen) {
    // For each array, we store the array and its startoffset (4 bytes)
    long estimatedSize = numArrays * ((long) avgArrayLen + 4);
    if (estimatedSize > 0 && estimatedSize <= Integer.MAX_VALUE) {
      return (int) estimatedSize;
    }
    return Integer.MAX_VALUE;
  }
@Test
  public void startSizeTest() {
    Assert.assertEquals(MutableOffHeapByteArrayStore.getStartSize(1, ONE_GB), ONE_GB + 4);
    Assert.assertEquals(MutableOffHeapByteArrayStore.getStartSize(3, ONE_GB), Integer.MAX_VALUE);
    Assert.assertEquals(MutableOffHeapByteArrayStore.getStartSize(5, ONE_GB), Integer.MAX_VALUE);
  }