IntSet previousVisitors = history.get(idx);
if (previousVisitors != null && previousVisitors.contains(node)) {
return true;
} else {
if (previousVisitors == null) {
previousVisitors = new IntHashSet(4);
history.put(idx, previousVisitors);
}
previousVisitors.add(node);
return false;
}