class PackedLongArray extends AbstractPackedLongArray {

    PackedLongArray() {}

    public PackedLongArray(final int virtualLength) {
        this(virtualLength, AbstractPackedArrayContext.MINIMUM_INITIAL_PACKED_ARRAY_CAPACITY);
    }

    public PackedLongArray(final int virtualLength, final int initialPhysicalLength) {
        setArrayContext(new PackedArrayContext(virtualLength, initialPhysicalLength));
    }

    @Override
    void resizeStorageArray(final int newPhysicalLengthInLongs) {
        AbstractPackedArrayContext oldArrayContext = getArrayContext();
        PackedArrayContext newArrayContext =
                new PackedArrayContext(oldArrayContext.getVirtualLength(), oldArrayContext, newPhysicalLengthInLongs);
        setArrayContext(newArrayContext);
        for (IterationValue v : oldArrayContext.nonZeroValues()) {
            set(v.getIndex(), v.getValue());
        }
    }

    @Override
    public void setVirtualLength(final int newVirtualArrayLength) {<FILL_FUNCTION_BODY>}

    @Override
    public PackedLongArray copy() {
        PackedLongArray copy = new PackedLongArray(this.length(), this.getPhysicalLength());
        copy.add(this);
        return copy;
    }

    @Override
    void clearContents() {
        getArrayContext().clearContents();
    }

    @Override
    long criticalSectionEnter() {
        return 0;
    }

    @Override
    void criticalSectionExit(final long criticalValueAtEnter) {
    }
}

        if (newVirtualArrayLength < length()) {
            throw new IllegalArgumentException(
                    "Cannot set virtual length, as requested length " + newVirtualArrayLength +
                            " is smaller than the current virtual length " + length());
        }
        AbstractPackedArrayContext currentArrayContext = getArrayContext();
        if (currentArrayContext.isPacked() &&
                (currentArrayContext.determineTopLevelShiftForVirtualLength(newVirtualArrayLength) ==
                        currentArrayContext.getTopLevelShift())) {
            // No changes to the array context contents is needed. Just change the virtual length.
            currentArrayContext.setVirtualLength(newVirtualArrayLength);
            return;
        }
        AbstractPackedArrayContext oldArrayContext = currentArrayContext;
        setArrayContext(new PackedArrayContext(newVirtualArrayLength, oldArrayContext, oldArrayContext.length()));
        for (IterationValue v : oldArrayContext.nonZeroValues()) {
            set(v.getIndex(), v.getValue());
        }
    
<methods>public void add(int, long) ,public void add(org.HdrHistogram.packedarray.AbstractPackedLongArray) ,public void clear() ,public abstract org.HdrHistogram.packedarray.AbstractPackedLongArray copy() ,public boolean equals(java.lang.Object) ,public long get(int) ,public long getEndTimeStamp() ,public int getPhysicalLength() ,public long getStartTimeStamp() ,public int hashCode() ,public void increment(int) ,public Iterator<java.lang.Long> iterator() ,public int length() ,public Iterable<org.HdrHistogram.packedarray.IterationValue> nonZeroValues() ,public void set(int, long) ,public void setEndTimeStamp(long) ,public void setStartTimeStamp(long) ,public abstract void setVirtualLength(int) ,public java.lang.String toString() <variables>static final int NUMBER_OF_NON_ZEROS_TO_HASH,private static final int NUMBER_OF_SETS,private org.HdrHistogram.packedarray.AbstractPackedArrayContext arrayContext,private long endTimeStampMsec,private long startTimeStampMsec