String pairs[][] = new String[3][3];
pairs[0][0] = "Half-Width and full-width A";
pairs[0][1] = "A";
pairs[0][2] = "\uFF21"; // full-width A
pairs[1][0] = "A with Ring and Angstrom Sign";
pairs[1][1] = "\u00c5"; // A with ring
pairs[1][2] = "\u212b"; // Angstrom
pairs[2][0] = "a + umlaut and precomposed a-umlaut";
pairs[2][1] = "a\u0308";
pairs[2][2] = "\u00e4";
for (int i = 0; i < 3; i++) {
Collator collate = Collator.getInstance(Locale.US);
collate.setStrength(Collator.IDENTICAL);
System.out.println("Comparing " + pairs[i][0]);
collate.setDecomposition(Collator.NO_DECOMPOSITION);
compare(collate, pairs[i][1],pairs[i][2]);
collate.setDecomposition(Collator.CANONICAL_DECOMPOSITION);
compare(collate, pairs[i][1],pairs[i][2]);
collate.setDecomposition(Collator.FULL_DECOMPOSITION);
compare(collate, pairs[i][1],pairs[i][2]);
System.out.println("");
}