void (@NotNull Object element, DefaultMutableTreeNode node) { element = TreeAnchorizer.getService().createAnchor(element); warnMap("myElementToNodeMap: createMapping: ", myElementToNodeMap); if (!myElementToNodeMap.containsKey(element)) { myElementToNodeMap.put(element, node); } else { Object value = myElementToNodeMap.get(element); List<DefaultMutableTreeNode> nodes; if (value instanceof DefaultMutableTreeNode) { nodes = new ArrayList<>(); nodes.add((DefaultMutableTreeNode)value); myElementToNodeMap.put(element, nodes); } else { //noinspection unchecked nodes = (List<DefaultMutableTreeNode>)value; } nodes.add(node); } }