@Override
	@SuppressWarnings("unchecked")
	public List<mxGraphAbstractHierarchyCell> getNextLayerConnectedCells(int layer)
	{
		if (nextLayerConnectedCells == null)
		{
			nextLayerConnectedCells = new ArrayList[1];
			nextLayerConnectedCells[0] = new ArrayList<mxGraphAbstractHierarchyCell>(connectsAsTarget.size());
			Iterator<mxGraphHierarchyEdge> iter = connectsAsTarget.iterator();
			
			while (iter.hasNext())
			{
				mxGraphHierarchyEdge edge = iter.next();

				if (edge.maxRank == -1 || edge.maxRank == layer + 1)
				{
					// Either edge is not in any rank or
					// no dummy nodes in edge, add node of other side of edge
					nextLayerConnectedCells[0].add(edge.source);
				}
				else
				{
					// Edge spans at least two layers, add edge
					nextLayerConnectedCells[0].add(edge);
				}
			}
		}

		return nextLayerConnectedCells[0];
	}