()
| 24 | |
| 25 | public class LazyableTest { |
| 26 | @Test |
| 27 | public void doTest() { |
| 28 | Lazyable<List<String>> lazyable = Lazyable.ofList(); |
| 29 | assertValue(lazyable); |
| 30 | |
| 31 | lazyable.getRoot().add("a"); |
| 32 | assertValue(lazyable, "a"); |
| 33 | lazyable.addLazyAction(list -> { |
| 34 | list.add("1"); |
| 35 | list.add("2"); |
| 36 | }); |
| 37 | assertValue(lazyable, "a", "1", "2"); |
| 38 | |
| 39 | lazyable.getRoot().add("b"); |
| 40 | assertValue(lazyable, "a", "b", "1", "2"); |
| 41 | } |
| 42 | |
| 43 | private void assertValue(Lazyable<List<String>> lazyable, String... result) { |
| 44 | String actual = lazyable.getResult().stream().collect(Collectors.joining("\n")); |
nothing calls this directly
no test coverage detected