void () { SliceTreeStructure treeStructure = configureTree("Duplicate"); SliceNode root = treeStructure.getRootElement(); SliceLeafAnalyzer analyzer = JavaSlicerAnalysisUtil.createLeafAnalyzer(); Map<SliceNode, Collection<PsiElement>> map = analyzer.createMap(); Collection<PsiElement> leaves = analyzer.calcLeafExpressions(root, treeStructure, map); assertNotNull(leaves); List<PsiElement> list = new ArrayList<>(leaves); String message = ContainerUtil.map(list, element -> element.getClass() + ": '" + element.getText() + "' (" + JavaSlicerAnalysisUtil.LEAF_ELEMENT_EQUALITY.hashCode(element) + ") ").toString(); assertEquals(map.entrySet()+"\n"+message, 2, leaves.size()); list.sort(Comparator.comparing(PsiElement::getText)); assertTrue(list.get(0) instanceof PsiLiteralExpression); assertEquals(false, ((PsiLiteral)list.get(0)).getValue()); assertTrue(list.get(1) instanceof PsiLiteralExpression); assertEquals(true, ((PsiLiteral)list.get(1)).getValue()); }