@Override
    public int calculateCapacity(int requiredLength) {   // 20% for growth
      return Math.max(8, Math.min((int)(requiredLength * 1.2), (requiredLength / 1024 + 1) * 1024));
    }
@Override
    public int calculateCapacity(int requiredLength)