public static <K extends Comparable<? super K>,V> LinkedHashMap<K,V> sort(Map<K,V> data) {
		LinkedHashMap<K,V> dup = new LinkedHashMap<K, V>();
		List<K> keys = new ArrayList<K>(data.keySet());
		Collections.sort(keys);
		for (K k : keys) {
			dup.put(k, data.get(k));
		}
		return dup;
	}
This is a regression test for antlr/antlr4#670 "exception when importing
grammar".
https://github.com/antlr/antlr4/issues/670
tool-testsuite/test/org/antlr/v4/test/tool/TestCompositeGrammars.java