public static void getAllContextNodes_(PredictionContext context,
										   List<PredictionContext> nodes,
										   Map<PredictionContext, PredictionContext> visited)
	{
		if ( context==null || visited.containsKey(context) ) return;
		visited.put(context, context);
		nodes.add(context);
		for (int i = 0; i < context.size(); i++) {
			getAllContextNodes_(context.getParent(i), nodes, visited);
		}
	}
Make pass over all <em>M</em> {@code parents}; merge any {@code equals()}
ones.
runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java