@Test public void shouldReturnZeroIfBoughWitoutSameMask() { assertEquals(0, compare("a.b.c.d/24", "d.e.f.g/24")); }
public static int compare(String s1, String s2) { if (isFullName(s1) && isFullName(s2)) { return netmaskCmp(s1, s2); } else if (isFullName(s1)) { return -1; } else if (isFullName(s2)) { return 1; } return maskCmp(s1, s2); }
HostEntryComparator { public static int compare(String s1, String s2) { if (isFullName(s1) && isFullName(s2)) { return netmaskCmp(s1, s2); } else if (isFullName(s1)) { return -1; } else if (isFullName(s2)) { return 1; } return maskCmp(s1, s2); } }
HostEntryComparator { public static int compare(String s1, String s2) { if (isFullName(s1) && isFullName(s2)) { return netmaskCmp(s1, s2); } else if (isFullName(s1)) { return -1; } else if (isFullName(s2)) { return 1; } return maskCmp(s1, s2); }  }
HostEntryComparator { public static int compare(String s1, String s2) { if (isFullName(s1) && isFullName(s2)) { return netmaskCmp(s1, s2); } else if (isFullName(s1)) { return -1; } else if (isFullName(s2)) { return 1; } return maskCmp(s1, s2); }  static int compare(String s1, String s2); }
HostEntryComparator { public static int compare(String s1, String s2) { if (isFullName(s1) && isFullName(s2)) { return netmaskCmp(s1, s2); } else if (isFullName(s1)) { return -1; } else if (isFullName(s2)) { return 1; } return maskCmp(s1, s2); }  static int compare(String s1, String s2);  }