@Test public void testComparePreferenceAdminEqual() { Rib rib = new Rib(); StaticRoute.Builder sb = StaticRoute.builder() .setNextHopInterface("foo") .setNetwork(Prefix.ZERO) .setAdministrativeCost(100); AbstractRoute route1 = sb.build(); AbstractRoute route2 = sb.build(); assertThat(rib.comparePreference(annotateRoute(route1), annotateRoute(route2)), equalTo(0)); }
@Override public int comparePreference( @Nonnull AnnotatedRoute<AbstractRoute> lhs, @Nonnull AnnotatedRoute<AbstractRoute> rhs) { return Comparator.comparing(AbstractRoute::getAdministrativeCost) .thenComparing(AbstractRoute::getMetric) .compare(rhs.getRoute(), lhs.getRoute()); }
Rib extends AnnotatedRib<AbstractRoute> implements Serializable { @Override public int comparePreference( @Nonnull AnnotatedRoute<AbstractRoute> lhs, @Nonnull AnnotatedRoute<AbstractRoute> rhs) { return Comparator.comparing(AbstractRoute::getAdministrativeCost) .thenComparing(AbstractRoute::getMetric) .compare(rhs.getRoute(), lhs.getRoute()); } }
Rib extends AnnotatedRib<AbstractRoute> implements Serializable { @Override public int comparePreference( @Nonnull AnnotatedRoute<AbstractRoute> lhs, @Nonnull AnnotatedRoute<AbstractRoute> rhs) { return Comparator.comparing(AbstractRoute::getAdministrativeCost) .thenComparing(AbstractRoute::getMetric) .compare(rhs.getRoute(), lhs.getRoute()); } Rib(); }
Rib extends AnnotatedRib<AbstractRoute> implements Serializable { @Override public int comparePreference( @Nonnull AnnotatedRoute<AbstractRoute> lhs, @Nonnull AnnotatedRoute<AbstractRoute> rhs) { return Comparator.comparing(AbstractRoute::getAdministrativeCost) .thenComparing(AbstractRoute::getMetric) .compare(rhs.getRoute(), lhs.getRoute()); } Rib(); @Override int comparePreference(
      @Nonnull AnnotatedRoute<AbstractRoute> lhs, @Nonnull AnnotatedRoute<AbstractRoute> rhs); @Override @Nonnull RibDelta<AnnotatedRoute<AbstractRoute>> mergeRouteGetDelta(
      AnnotatedRoute<AbstractRoute> route); }
Rib extends AnnotatedRib<AbstractRoute> implements Serializable { @Override public int comparePreference( @Nonnull AnnotatedRoute<AbstractRoute> lhs, @Nonnull AnnotatedRoute<AbstractRoute> rhs) { return Comparator.comparing(AbstractRoute::getAdministrativeCost) .thenComparing(AbstractRoute::getMetric) .compare(rhs.getRoute(), lhs.getRoute()); } Rib(); @Override int comparePreference(
      @Nonnull AnnotatedRoute<AbstractRoute> lhs, @Nonnull AnnotatedRoute<AbstractRoute> rhs); @Override @Nonnull RibDelta<AnnotatedRoute<AbstractRoute>> mergeRouteGetDelta(
      AnnotatedRoute<AbstractRoute> route);  }