<BUG>NodeExistsCommand command = new NodeExistsCommand(nodeStore, path, mongoSync.getHeadRevisionId());command.setBranchId(branchId);if (command.execute()) {</BUG><CONTEXT>if (affectedPaths == null || affectedPaths.isEmpty()) {existingNodes = Collections.emptyMap();}existingNodes = new HashMap<String, MongoNode>();for (String path : affectedPaths) {<extra_id_0>existingNodes.put(path, command.getNode());</CONTEXT>
NodeExistsCommand command;if (branchId == null) {command = new NodeExistsCommand(nodeStore, path, mongoSync.getHeadRevisionId());} else {command = new NodeExistsCommand(nodeStore, path, baseRevisionId);if (command.execute()) {