int (int shortIndex) { checkShortIndex(shortIndex); int blockIndex = lastInsertionPoint(mySubSumOfBlocks, shortIndex); int prefVisibleCount = 0; if (blockIndex > 0) prefVisibleCount = mySubSumOfBlocks[blockIndex - 1]; for (int longIndex = blockIndex * myBlockSize; longIndex < myLongSize; longIndex++) { if (myVisibility.get(longIndex)) prefVisibleCount++; if (prefVisibleCount > shortIndex) return longIndex; } throw new IllegalAccessError("This should never happen!"); }