private void ensureCapacity(int minimalCapacity)
    {
        int required = minimalCapacity - FIELDS_STORE_SIZE;
        if (required <= 0) throw new IllegalArgumentException();
        if (data == null) {
            int alloc = FIELDS_STORE_SIZE * 2;
            if (alloc < required) {
                alloc = required;
            }
            data = new Object[alloc];
        } else {
            int alloc = data.length;
            if (alloc < required) {
                   if (alloc <= FIELDS_STORE_SIZE) {
                    alloc = FIELDS_STORE_SIZE * 2;
                } else {
                    alloc *= 2;
                }
                if (alloc < required) {
                    alloc = required;
                }
                Object[] tmp = new Object[alloc];
                if (size > FIELDS_STORE_SIZE) {
                    System.arraycopy(data, 0, tmp, 0,
                                     size - FIELDS_STORE_SIZE);
                }
                data = tmp;
            }
        }
    }