### Question:
ChromosomeComparator implements Comparator<String>, Serializable { @Override public int compare(String arg0, String arg1) { if (arg0.equals(arg1)) { return 0; } if (arg0.equals("MT")) { return 1; } if (arg1.equals("MT")) { return -1; } if (arg0.length() == 1) { if (arg1.length() == 1) { return arg0.charAt(0) - arg1.charAt(0); } else if (arg0.charAt(0) == 'X') { return 1; } else if (arg0.charAt(0) == 'Y') { return 1; } else { return -1; } } if (arg1.length() == 1) { if (arg1.charAt(0) == 'X') { return -1; } else if (arg1.charAt(0) == 'Y') { return -1; } else { return 1; } } return arg0.compareTo(arg1); }  static boolean chrASmallerChrB(String chrA, String chrB); static boolean chrASmallerEqualChrB(String chrA, String chrB); static boolean chrALargerChrB(String chrA, String chrB); @Override int compare(String arg0, String arg1); static final ChromosomeComparator comparator; }### Answer:
@Test public void compare() { Comparator<String> testComparator = new ChromosomeComparator(); assertEquals(testComparator.compare("1", "2") < 0, true); assertEquals(testComparator.compare("1", "1") == 0, true); assertEquals(testComparator.compare("3", "1") > 0, true); assertEquals(testComparator.compare("3", "13") < 0, true); assertEquals(testComparator.compare("13", "3") > 0, true); assertEquals(testComparator.compare("9", "10") < 0, true); assertEquals(testComparator.compare("10", "11") < 0, true); assertEquals(testComparator.compare("9", "21") < 0, true); assertEquals(testComparator.compare("19", "20") < 0, true); assertEquals(testComparator.compare("22", "X") < 0, true); assertEquals(testComparator.compare("10", "X") < 0, true); assertEquals(testComparator.compare("1", "X") < 0, true); assertEquals(testComparator.compare("X", "5") > 0, true); assertEquals(testComparator.compare("5", "X") < 0, true); assertEquals(testComparator.compare("X", "13") > 0, true); assertEquals(testComparator.compare("13", "X") < 0, true); assertEquals(testComparator.compare("X", "X") == 0, true); assertEquals(testComparator.compare("Y", "X") > 0, true); assertEquals(testComparator.compare("MT", "X") > 0, true); assertEquals(testComparator.compare("X", "MT") < 0, true); assertEquals(testComparator.compare("MT", "Y") > 0, true); assertEquals(testComparator.compare("Y", "MT") < 0, true); assertEquals(testComparator.compare("MT", "1") > 0, true); assertEquals(testComparator.compare("1", "MT") < 0, true); assertEquals(testComparator.compare("MT", "10") > 0, true); assertEquals(testComparator.compare("10", "MT") < 0, true); assertEquals(testComparator.compare("22", "23") < 0, true); assertEquals(testComparator.compare("23", "22") > 0, true); }