SystemPropertySupplier implements Supplier<T> { public static <U> SystemPropertySupplier<U> create(@NotNull String propName, @NotNull U defaultValue) throws IllegalArgumentException { return new SystemPropertySupplier<U>(propName, defaultValue); } private  SystemPropertySupplier(@NotNull String propName, @NotNull T defaultValue); static SystemPropertySupplier<U> create(@NotNull String propName, @NotNull U defaultValue); SystemPropertySupplier<T> loggingTo(@NotNull Logger log); SystemPropertySupplier<T> validateWith(@NotNull Predicate<T> validator); SystemPropertySupplier<T> formatSetMessage(@NotNull BiFunction<String, T, String> setMessageFormatter); SystemPropertySupplier<T> logSuccessAs(Level successLogLevel); T get();  }
@Test public void testUnsupportedType() { try { SystemPropertySupplier.create("foo", new Object()); } catch (IllegalArgumentException expected) { } }