@Override
	@SuppressWarnings("unchecked")
	public List<mxGraphAbstractHierarchyCell> getPreviousLayerConnectedCells(int layer)
	{
		if (previousLayerConnectedCells == null)
		{
			previousLayerConnectedCells = new ArrayList[1];
			previousLayerConnectedCells[0] = new ArrayList<mxGraphAbstractHierarchyCell>(connectsAsSource
					.size());
			Iterator<mxGraphHierarchyEdge> iter = connectsAsSource.iterator();

			while (iter.hasNext())
			{
				mxGraphHierarchyEdge edge = iter.next();

				if (edge.minRank == -1 || edge.minRank == layer - 1)
				{
					// No dummy nodes in edge, add node of other side of edge
					previousLayerConnectedCells[0].add(edge.target);
				}
				else
				{
					// Edge spans at least two layers, add edge
					previousLayerConnectedCells[0].add(edge);
				}
			}
		}

		return previousLayerConnectedCells[0];
	}