text: public Position get(int pos) {while(pos >= nextPos) {if (count == positions.length) {Position[] newPositions = new Position[ArrayUtil.oversize(1+count, RamUsageEstimator.NUM_BYTES_OBJECT_REF)];System.arraycopy(positions, nextWrite, newPositions, 0, positions.length-nextWrite);System.arraycopy(positions, 0, newPositions, positions.length-nextWrite, nextWrite);for(int i=positions.length;i<newPositions.length;i++) {newPositions[i] = new Position();}nextWrite = positions.length;positions = newPositions;}if (nextWrite == positions.length) {nextWrite = 0;}assert positions[nextWrite].count == 0;positions[nextWrite++].pos = nextPos++;count++;}assert inBounds(pos);final int index = getIndex(pos);assert positions[index].pos == pos;return positions[index];}