@Test public void testCompare_UNDERSCORE_DEFAULT() { assertThat(TRANSLATION_COMPARATOR.compare( new Translation(Language.of("_"), "underscore"), new Translation(Language.of("<default>"), "default") )).isLessThan(0); assertThat(TRANSLATION_COMPARATOR.compare( new Translation(Language.of("<default>"), "default"), new Translation(Language.of("_"), "underscore") )).isGreaterThan(0); }
@Override public int compare(final Translation o1, final Translation o2) { if (o1 == o2) { return 0; } if (o1 == null) { return 1; } if (o2 == null) { return -1; } if (o1.getLang().equals(o2.getLang())) { return o1.getValue().compareTo(o2.getValue()); } if (o1.getLang().equals(Language.of(""))) { return -1; } else if (o2.getLang().equals(Language.of(""))) { return 1; } if (o1.getLang().equals(Language.of("_"))) { return -1; } else if (o2.getLang().equals(Language.of("_"))) { return 1; } if (o1.getLang().getLang().startsWith("<")) { return -1; } else if (o2.getLang().getLang().startsWith("<")) { return 1; } return o1.getLang().compareTo(o2.getLang()); }
TranslationComparator implements Comparator<Translation> { @Override public int compare(final Translation o1, final Translation o2) { if (o1 == o2) { return 0; } if (o1 == null) { return 1; } if (o2 == null) { return -1; } if (o1.getLang().equals(o2.getLang())) { return o1.getValue().compareTo(o2.getValue()); } if (o1.getLang().equals(Language.of(""))) { return -1; } else if (o2.getLang().equals(Language.of(""))) { return 1; } if (o1.getLang().equals(Language.of("_"))) { return -1; } else if (o2.getLang().equals(Language.of("_"))) { return 1; } if (o1.getLang().getLang().startsWith("<")) { return -1; } else if (o2.getLang().getLang().startsWith("<")) { return 1; } return o1.getLang().compareTo(o2.getLang()); } }
TranslationComparator implements Comparator<Translation> { @Override public int compare(final Translation o1, final Translation o2) { if (o1 == o2) { return 0; } if (o1 == null) { return 1; } if (o2 == null) { return -1; } if (o1.getLang().equals(o2.getLang())) { return o1.getValue().compareTo(o2.getValue()); } if (o1.getLang().equals(Language.of(""))) { return -1; } else if (o2.getLang().equals(Language.of(""))) { return 1; } if (o1.getLang().equals(Language.of("_"))) { return -1; } else if (o2.getLang().equals(Language.of("_"))) { return 1; } if (o1.getLang().getLang().startsWith("<")) { return -1; } else if (o2.getLang().getLang().startsWith("<")) { return 1; } return o1.getLang().compareTo(o2.getLang()); }  }
TranslationComparator implements Comparator<Translation> { @Override public int compare(final Translation o1, final Translation o2) { if (o1 == o2) { return 0; } if (o1 == null) { return 1; } if (o2 == null) { return -1; } if (o1.getLang().equals(o2.getLang())) { return o1.getValue().compareTo(o2.getValue()); } if (o1.getLang().equals(Language.of(""))) { return -1; } else if (o2.getLang().equals(Language.of(""))) { return 1; } if (o1.getLang().equals(Language.of("_"))) { return -1; } else if (o2.getLang().equals(Language.of("_"))) { return 1; } if (o1.getLang().getLang().startsWith("<")) { return -1; } else if (o2.getLang().getLang().startsWith("<")) { return 1; } return o1.getLang().compareTo(o2.getLang()); }  @Override int compare(final Translation o1, final Translation o2); }
TranslationComparator implements Comparator<Translation> { @Override public int compare(final Translation o1, final Translation o2) { if (o1 == o2) { return 0; } if (o1 == null) { return 1; } if (o2 == null) { return -1; } if (o1.getLang().equals(o2.getLang())) { return o1.getValue().compareTo(o2.getValue()); } if (o1.getLang().equals(Language.of(""))) { return -1; } else if (o2.getLang().equals(Language.of(""))) { return 1; } if (o1.getLang().equals(Language.of("_"))) { return -1; } else if (o2.getLang().equals(Language.of("_"))) { return 1; } if (o1.getLang().getLang().startsWith("<")) { return -1; } else if (o2.getLang().getLang().startsWith("<")) { return 1; } return o1.getLang().compareTo(o2.getLang()); }  @Override int compare(final Translation o1, final Translation o2); static final TranslationComparator INSTANCE; }