public static < T > ValueHolder < T > withNonNullValue ( final T value ) { Assert . notNull ( value , "The value must not be null!" ) ; return new ValueHolder < T > ( value ) { @ Override public void setValue ( final T value ) { Assert . notNull ( value , "The value must not be null!" ) ; super . setValue ( value ) ; } } ; }
Factory method to construct an instance of the ValueHolder class with a non - null value .