}
throw new IllegalArgumentException("can only compare MemberPeers and OrderSets");
}
public int compare(final FacetedMethod o1, final FacetedMethod o2) {
final MemberOrderFacet m1 = getMemberOrder(o1);
final MemberOrderFacet m2 = getMemberOrder(o2);
if (m1 == null && m2 == null) {
return fallbackComparator.compare(o1, o2);
}
if (m1 == null && m2 != null) {
return +1; // annotated before non-annotated
}
if (m1 != null && m2 == null) {
return -1; // annotated before non-annotated
}
if (ensureInSameGroup && !m1.name().equals(m2.name())) {
throw new IllegalArgumentException("Not in same group");
}
final String sequence1 = m1.sequence();
final String sequence2 = m2.sequence();
final String[] components1 = componentsFor(sequence1);
final String[] components2 = componentsFor(sequence2);
final int length1 = components1.length;