Would it be better to do something like the following?
```
visited.clear();
visited.addAll(checkpointVisitedSet);
```