@Test public void of() { final Supplier<Integer> s = Suppliers.of(1); for (int i = 0; i < 10; i++) { assertThat(s.get(), is(1)); } }
public static <T> Supplier<T> of(final T value) { checkNotNull(value); return new Supplier<T>() { @Override public T get() { return value; } @Override public String toString() { return value.toString(); } }; }
Suppliers { public static <T> Supplier<T> of(final T value) { checkNotNull(value); return new Supplier<T>() { @Override public T get() { return value; } @Override public String toString() { return value.toString(); } }; } }
Suppliers { public static <T> Supplier<T> of(final T value) { checkNotNull(value); return new Supplier<T>() { @Override public T get() { return value; } @Override public String toString() { return value.toString(); } }; } private  Suppliers(); }
Suppliers { public static <T> Supplier<T> of(final T value) { checkNotNull(value); return new Supplier<T>() { @Override public T get() { return value; } @Override public String toString() { return value.toString(); } }; } private  Suppliers(); static Supplier<T> of(final T value); static Supplier<T> cycle(final List<T> values); static Supplier<Long> cycle(final long minValue, final long maxValue); static RandomSupplier.Builder<T> random(); static Supplier<Long> random(final long minValue, final long maxValue); }
Suppliers { public static <T> Supplier<T> of(final T value) { checkNotNull(value); return new Supplier<T>() { @Override public T get() { return value; } @Override public String toString() { return value.toString(); } }; } private  Suppliers(); static Supplier<T> of(final T value); static Supplier<T> cycle(final List<T> values); static Supplier<Long> cycle(final long minValue, final long maxValue); static RandomSupplier.Builder<T> random(); static Supplier<Long> random(final long minValue, final long maxValue);  }