private long deleteByIndex(final long index)
	{
		assert 0 <= index && index < this.borderIndex : "Index: " + index + " - Border: "
				+ this.borderIndex + " - MaxNum: " + this.maxNum + " replace: "
			+ this.replace.get(index);

		final long preBorderIndex = this.borderIndex - 1;
		final long preBorderElement = replace.containsKey(preBorderIndex) ? this.replace
				.get(preBorderIndex) : preBorderIndex;
		final long drawnElement = replace.containsKey(index) ? this.replace.get(index) : index;

		final long result = drawnElement;
		if (preBorderIndex == index)
		{
			assert preBorderElement == drawnElement;

			if (preBorderElement != preBorderIndex)
			{
				replace.remove(preBorderElement);
				replace.remove(preBorderIndex);
			}
		}
		else
		{
			createReplacePointer(preBorderElement, index);

			if (preBorderElement != preBorderIndex) // Cases 2 and 4
			{
				replace.remove(preBorderIndex);
			}

			if (drawnElement != index) // Cases 3 and 4
			{
				replace.remove(drawnElement);
			}

		}

		--this.borderIndex;

		return result;
	}