private Node findEndOfSplit(List<Link> toFollow) {
		if (toFollow.size() == 0) {
			return null;
		}
		if (toFollow.size() == 1) {
			// return the first node...
			return findNodeById(toFollow.get(0).to);
		}
		// Follow the first link. For each node found see if it
		// exists down the chain of all the other links (i.e. is a common target)
		Link link = toFollow.get(0);
		Node nextCandidate = findNodeById(link.to);
		while (nextCandidate != null) {
			boolean allLinksLeadToTheCandidate = true;
			for (int l = 1; l < toFollow.size(); l++) {
				if (!foundInChain(toFollow.get(l), nextCandidate)) {
					allLinksLeadToTheCandidate = false;
					break;
				}
			}
			if (allLinksLeadToTheCandidate) {
				return nextCandidate;
			}
			List<Link> links = findLinksFrom(nextCandidate, true);
			if (links.size() == 0) {
				nextCandidate = null;
			}
			else if (links.size() == 1) {
				nextCandidate = findNodeById(links.get(0).to);
			}
			else {
				if (countLinksWithoutTransitions(links) == 0 || countLinksWithoutTransitions(links) == 1) {
					// Assert: it doesn't therefore matter which one is chosen, they will come together at
					// the same place
					nextCandidate = findNodeById(links.get(0).to);
				}
				else {
					while (countLinksWithoutTransitions(links) > 1) {
						nextCandidate = findEndOfSplit(links);
						links = findLinksFrom(nextCandidate, true);
					}
				}
			}
		}
		// This indicates a broken graph
		throw new IllegalStateException("Unable to find end of split");
	}
Chase down links, populating the graphText as it proceeds.

@param graphText where to place the DSL text as we process the graph
@param toFollow the links to follow
@param nodeToTerminateFollow the node that should trigger termination of following
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/job/dsl/Graph.java