@Test
void shouldCreateTree() {

    final TestResult first = new TestResult()
            .setName("first")
            .setStatus(Status.BROKEN)
            .setStatusMessage("M1");
    final TestResult second = new TestResult()
            .setName("second")
            .setStatus(Status.FAILED)
            .setStatusMessage("M2");
    final TestResult third = new TestResult()
            .setName("third")
            .setStatus(Status.BROKEN)
            .setStatusMessage("M3");
    final TestResult other = new TestResult()
            .setName("other")
            .setStatus(Status.PASSED)
            .setStatusMessage("M4");
    first.addExtraBlock(CATEGORIES, singletonList(new Category().setName("C1")));
    second.addExtraBlock(CATEGORIES, singletonList(new Category().setName("C2")));
    third.addExtraBlock(CATEGORIES, singletonList(new Category().setName("C1")));
    other.addExtraBlock(CATEGORIES, singletonList(new Category().setName("C3")));
    final List<LaunchResults> launchResults = createSingleLaunchResults(first, second, third, other);
    final Tree<TestResult> tree = CategoriesPlugin.getData(launchResults);
    assertThat(tree.getChildren())
            .hasSize(3)
            .extracting(TreeNode::getName)
            .containsExactlyInAnyOrder("C1", "C2", "C3");
    assertThat(tree.getChildren())
            .filteredOn("name", "C1")
            .flatExtracting("children")
            .extracting("name")
            .containsExactlyInAnyOrder("M1", "M3");
    assertThat(tree.getChildren())
            .filteredOn("name", "C1")
            .flatExtracting("children")
            .flatExtracting("children")
            .extracting("name")
            .containsExactlyInAnyOrder("first", "third");
}