private void RemoveItem(T item)
        {
            // Remove broad phase info
            var itemInfo = _itemInfos.Get(item);

            if (itemInfo == null) // Abort if the object was not in the broad phase.
            {
                return;
            }

            // Remove from _itemInfos.
            _itemInfos.Remove(item);

            // Remove edges from edge lists.
            for (int axisIndex = 0; axisIndex < 3; axisIndex++)
            {
                // Get indices in edge list.
                int minEdgeIndex = itemInfo.MinEdgeIndices[axisIndex];
                int maxEdgeIndex = itemInfo.MaxEdgeIndices[axisIndex];

                // Update edge indices in itemInfo that point into edge list for edges above the min edge.
                List <Edge> edgeList      = _edges[axisIndex];
                int         numberOfEdges = edgeList.Count;
                for (int i = minEdgeIndex + 1; i < numberOfEdges; i++)
                {
                    // Subtract one for edges that were before the max edge to remove, and subtract 2 for the rest.
                    // TODO: We could split the loop into two parts. The part before maxEdgeIndex and the part after.
                    int decrement = (i > maxEdgeIndex) ? 2 : 1;

                    var currentItemInfo = edgeList[i].Info;
                    if (edgeList[i].IsMax == false)
                    {
                        currentItemInfo.MinEdgeIndices[axisIndex] = i - decrement;
                    }
                    else
                    {
                        currentItemInfo.MaxEdgeIndices[axisIndex] = i - decrement;
                    }
                }

                // Remove from edge list.
                edgeList.RemoveAt(maxEdgeIndex);
                edgeList.RemoveAt(minEdgeIndex);
            }

            // Remove related self-overlaps.
            if (_broadPhase != null)
            {
                _broadPhase.Remove(item);
            }

            if (EnableSelfOverlaps)
            {
                // TODO: Lambda method produces garbage.
                SelfOverlaps.RemoveWhere(overlap => Comparer.Equals(overlap.First, item) || Comparer.Equals(overlap.Second, item));
            }
        }