@Test public void nestedScopeHierarchyToString() { MortarScope root = MortarScope.buildRootScope().build("Root"); root.buildChild().build("Cadet"); MortarScope colonel = root.buildChild().build("Colonel"); colonel.buildChild().build("ElderColonel"); colonel.buildChild().build("ZeElderColonel"); MortarScope elder = root.buildChild().build("Elder"); elder.buildChild().build("ElderCadet"); elder.buildChild().build("ZeElderCadet"); elder.buildChild().build("ElderElder"); elder.buildChild().build("AnElderCadet"); String hierarchy = scopeHierarchyToString(root); assertThat(hierarchy).isEqualTo("" + "Mortar Hierarchy:\n" + BLANK + "SCOPE Root\n" + BLANK + "+-SCOPE Cadet\n" + BLANK + "+-SCOPE Colonel\n" + BLANK + "| +-SCOPE ElderColonel\n" + BLANK + "| `-SCOPE ZeElderColonel\n" + BLANK + "`-SCOPE Elder\n" + BLANK + " +-SCOPE AnElderCadet\n" + BLANK + " +-SCOPE ElderCadet\n" + BLANK + " +-SCOPE ElderElder\n" + BLANK + " `-SCOPE ZeElderCadet\n" ); }
public static String scopeHierarchyToString(MortarScope mortarScope) { StringBuilder result = new StringBuilder("Mortar Hierarchy:\n"); MortarScope rootScope = getRootScope(mortarScope); Node rootNode = new MortarScopeNode(rootScope); nodeHierarchyToString(result, 0, 0, rootNode); return result.toString(); }
MortarScopeDevHelper { public static String scopeHierarchyToString(MortarScope mortarScope) { StringBuilder result = new StringBuilder("Mortar Hierarchy:\n"); MortarScope rootScope = getRootScope(mortarScope); Node rootNode = new MortarScopeNode(rootScope); nodeHierarchyToString(result, 0, 0, rootNode); return result.toString(); } }
MortarScopeDevHelper { public static String scopeHierarchyToString(MortarScope mortarScope) { StringBuilder result = new StringBuilder("Mortar Hierarchy:\n"); MortarScope rootScope = getRootScope(mortarScope); Node rootNode = new MortarScopeNode(rootScope); nodeHierarchyToString(result, 0, 0, rootNode); return result.toString(); } private  MortarScopeDevHelper(); }
MortarScopeDevHelper { public static String scopeHierarchyToString(MortarScope mortarScope) { StringBuilder result = new StringBuilder("Mortar Hierarchy:\n"); MortarScope rootScope = getRootScope(mortarScope); Node rootNode = new MortarScopeNode(rootScope); nodeHierarchyToString(result, 0, 0, rootNode); return result.toString(); } private  MortarScopeDevHelper(); static String scopeHierarchyToString(MortarScope mortarScope); }
MortarScopeDevHelper { public static String scopeHierarchyToString(MortarScope mortarScope) { StringBuilder result = new StringBuilder("Mortar Hierarchy:\n"); MortarScope rootScope = getRootScope(mortarScope); Node rootNode = new MortarScopeNode(rootScope); nodeHierarchyToString(result, 0, 0, rootNode); return result.toString(); } private  MortarScopeDevHelper(); static String scopeHierarchyToString(MortarScope mortarScope);  }