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