List<Way> result = new ArrayList<>();
List<List<Node>> chunks = buildNodeChunks(way, nodes);
if (chunks.size() > 1) {
SplitWayResult split = SplitWayAction.splitWay(Main.main.getEditLayer(), way, chunks, Collections.<OsmPrimitive>emptyList());
//execute the command, we need the results
cmds.add(split.getCommand());
commitCommands(marktr("Split ways into fragments"));
result.add(split.getOriginalWay());
result.addAll(split.getNewWays());
} else {
//nothing to split
result.add(way);
}