} else { int index = upperBound(head, tail - 1, elem); int newIndex = (index - head); System.arraycopy(objects, head, newObjects, 0, newIndex); } else { int index = upperBound(head, tail - 1, elem); System.arraycopy(objects, index, objects, index + 1, tail - index); objects[index] = elem;