@Test void limitShouldThrowAnErrorWhenCalledWithZero() { assertThatIllegalArgumentException() .isThrownBy(() -> Limit.limit(0)); }
public static Limit limit(int limit) { Preconditions.checkArgument(limit > 0, "limit should be positive"); return new Limit(Optional.of(limit)); }
Limit { public static Limit limit(int limit) { Preconditions.checkArgument(limit > 0, "limit should be positive"); return new Limit(Optional.of(limit)); } }
Limit { public static Limit limit(int limit) { Preconditions.checkArgument(limit > 0, "limit should be positive"); return new Limit(Optional.of(limit)); } private  Limit(Optional<Integer> limit); }
Limit { public static Limit limit(int limit) { Preconditions.checkArgument(limit > 0, "limit should be positive"); return new Limit(Optional.of(limit)); } private  Limit(Optional<Integer> limit); static Limit from(int limit); static Limit from(Optional<Integer> limit); static Limit unlimited(); static Limit limit(int limit); Optional<Integer> getLimit(); boolean isUnlimited(); Stream<T> applyOnStream(Stream<T> stream); Flux<T> applyOnFlux(Flux<T> flux); @Override final boolean equals(Object o); @Override final int hashCode(); }
Limit { public static Limit limit(int limit) { Preconditions.checkArgument(limit > 0, "limit should be positive"); return new Limit(Optional.of(limit)); } private  Limit(Optional<Integer> limit); static Limit from(int limit); static Limit from(Optional<Integer> limit); static Limit unlimited(); static Limit limit(int limit); Optional<Integer> getLimit(); boolean isUnlimited(); Stream<T> applyOnStream(Stream<T> stream); Flux<T> applyOnFlux(Flux<T> flux); @Override final boolean equals(Object o); @Override final int hashCode();  }