void (TreeVisitor @NotNull [] array, int count, @NotNull String expected, @NotNull Consumer<? super TreeTest> then) { TreeTest.test(TreeUtilVisitTest::rootDeep, test -> TreeUtil.promiseSelect(test.getTree(), Stream.of(array)).onProcessed(paths -> { test.invokeSafely(() -> { if (count == 0) { Assert.assertNull(paths); } else { Assert.assertNotNull(paths); Assert.assertEquals(count, paths.size()); } test.assertTree(expected, true, () -> then.accept(test)); }); })); }