@Test public void testEqualUnboundedInstances() { o1 = PhraseHighlight.createEntire(); o2 = PhraseHighlight.createEntire(); int result = PhraseHighlightComparator.INSTANCE.compare(o1, o2); assertEquals("o1[,] should be == o2[,]", 0, result); }
@Override public int compare(PhraseHighlight o1, PhraseHighlight o2) { int cmp; if (o1.getLineStart() < 0) { if (o2.getLineStart() >= 0) { return -1; } cmp = 0; } else if (o2.getLineStart() < 0) { return 1; } else { cmp = Integer.compare(o1.getLineStart(), o2.getLineStart()); } if (cmp != 0) { return cmp; } cmp = Integer.compare(o2.getLineEnd(), o1.getLineEnd()); return cmp; }
PhraseHighlightComparator implements Comparator<PhraseHighlight> { @Override public int compare(PhraseHighlight o1, PhraseHighlight o2) { int cmp; if (o1.getLineStart() < 0) { if (o2.getLineStart() >= 0) { return -1; } cmp = 0; } else if (o2.getLineStart() < 0) { return 1; } else { cmp = Integer.compare(o1.getLineStart(), o2.getLineStart()); } if (cmp != 0) { return cmp; } cmp = Integer.compare(o2.getLineEnd(), o1.getLineEnd()); return cmp; } }
PhraseHighlightComparator implements Comparator<PhraseHighlight> { @Override public int compare(PhraseHighlight o1, PhraseHighlight o2) { int cmp; if (o1.getLineStart() < 0) { if (o2.getLineStart() >= 0) { return -1; } cmp = 0; } else if (o2.getLineStart() < 0) { return 1; } else { cmp = Integer.compare(o1.getLineStart(), o2.getLineStart()); } if (cmp != 0) { return cmp; } cmp = Integer.compare(o2.getLineEnd(), o1.getLineEnd()); return cmp; } private  PhraseHighlightComparator(); }
PhraseHighlightComparator implements Comparator<PhraseHighlight> { @Override public int compare(PhraseHighlight o1, PhraseHighlight o2) { int cmp; if (o1.getLineStart() < 0) { if (o2.getLineStart() >= 0) { return -1; } cmp = 0; } else if (o2.getLineStart() < 0) { return 1; } else { cmp = Integer.compare(o1.getLineStart(), o2.getLineStart()); } if (cmp != 0) { return cmp; } cmp = Integer.compare(o2.getLineEnd(), o1.getLineEnd()); return cmp; } private  PhraseHighlightComparator(); @Override int compare(PhraseHighlight o1, PhraseHighlight o2); }
PhraseHighlightComparator implements Comparator<PhraseHighlight> { @Override public int compare(PhraseHighlight o1, PhraseHighlight o2) { int cmp; if (o1.getLineStart() < 0) { if (o2.getLineStart() >= 0) { return -1; } cmp = 0; } else if (o2.getLineStart() < 0) { return 1; } else { cmp = Integer.compare(o1.getLineStart(), o2.getLineStart()); } if (cmp != 0) { return cmp; } cmp = Integer.compare(o2.getLineEnd(), o1.getLineEnd()); return cmp; } private  PhraseHighlightComparator(); @Override int compare(PhraseHighlight o1, PhraseHighlight o2); static final PhraseHighlightComparator INSTANCE; }