Functionality.rearrangeFunctionalities(arrangements);
rearrangeFunctionalities(arrangements);
    private void updateStructure(List<Functionality> roots, String structure) throws Exception {        List<Pair<Module, Functionality>> arrangements = new ArrayList<Pair<Module, Functionality>>();                List<Functionality> functionalities = flatten(roots);                String[] nodes = structure.split(",");        for (int i = 0; i < nodes.length; i++) {            String[] parts = nodes[i].split("-");                        Integer childIndex = getId(parts[0]);            Integer parentIndex = getId(parts[1]);            Module parent = (Module) functionalities.get(parentIndex);            Functionality child = functionalities.get(childIndex);                     arrangements.add(new Pair<Module, Functionality>(parent, child));        }                Functionality.rearrangeFunctionalities(arrangements);    }