VersionedRouteImpl implements VersionedRoute { @Override public VersionedRoute removedIn(int removedIn) { checkArgument(removedIn >= 0, "removedIn must be non-negative, got %s", removedIn); verifyRangeNonEmpty(validFrom(), Optional.of(removedIn)); return new AutoValue_VersionedRouteImpl(route(), validFrom(), Optional.of(removedIn)); }  @Override VersionedRoute validFrom(int validFrom); @Override VersionedRoute removedIn(int removedIn);  }
@Test public void shouldDisallowNegativeRemovedIn() throws Exception { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("non-negative"); thrown.expectMessage("removedIn"); versionedRoute.removedIn(-10); }