File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/test/java/com/plugatar/jkscope Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1919import org .junit .jupiter .api .Test ;
2020
2121import static com .plugatar .jkscope .JKScope .lazy ;
22+ import static com .plugatar .jkscope .JKScope .lazyOf ;
2223import static org .assertj .core .api .Assertions .assertThat ;
2324import static org .assertj .core .api .Assertions .assertThatThrownBy ;
2425import static org .mockito .Mockito .doReturn ;
@@ -172,4 +173,17 @@ void lazyMethodWithThreadSafetyModeAndSupplierUnsafeMode() {
172173 ).isSameAs (result );
173174 verify (initializer , times (1 )).get ();
174175 }
176+
177+ @ Test
178+ void lazyOfMethod () {
179+ final Object result = new Object ();
180+ final Lazy <Object > lazy = lazyOf (result );
181+
182+ assertThat (
183+ lazy .get ()
184+ ).isSameAs (result );
185+ assertThat (
186+ lazy .get ()
187+ ).isSameAs (result );
188+ }
175189}
You can’t perform that action at this time.
0 commit comments