@Test
public void testIndirectRecursiveIssue() throws Exception {

    when(navigationServices.loadNavTree()).thenReturn(new NavTreeBuilder()
            .group("groupA", "", "", true)
                .item("layout", "", "", true, NavWorkbenchCtx.perspective("B"))
                .endGroup()
            .group("groupB", "", "", true)
                .item("layout", "", "", true, NavWorkbenchCtx.perspective("A"))
                .endGroup()
            .build());
    LayoutRecursionIssue info = layoutTemplateAnalyzer.analyzeRecursion(layoutA);
    assertEquals(info.getRefList().size(), 7);
    assertEquals(info.getRefList().get(0), new LayoutNavigationRef(PERSPECTIVE, "A"));
    assertEquals(info.getRefList().get(1), new LayoutNavigationRef(NAV_COMPONENT, CAROUSEL.getFQClassName()));
    assertEquals(info.getRefList().get(2), new LayoutNavigationRef(NAV_GROUP_DEFINED, "groupA"));
    assertEquals(info.getRefList().get(3), new LayoutNavigationRef(PERSPECTIVE, "B"));
    assertEquals(info.getRefList().get(4), new LayoutNavigationRef(NAV_COMPONENT, CAROUSEL.getFQClassName()));
    assertEquals(info.getRefList().get(5), new LayoutNavigationRef(NAV_GROUP_DEFINED, "groupB"));
    assertEquals(info.getRefList().get(6), new LayoutNavigationRef(PERSPECTIVE, "A"));
}