fix: use Collections.newSetFromMap(new IdentityHashMap<Object, Boolean>()) for loop detection