Implement hashCode and equals on ImmutableCapabilities
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.Map;
-import java.util.Stack;
public class ImmutableCapabilities implements Capabilities, Serializable {
@@ -74,11 +73,9 @@ public int hashCode() {
return caps.hashCode();
}
+ @Override
public String toString() {
Map<Object, String> seen = new IdentityHashMap<>();
- Stack<Object> toVisit = new Stack<>();
- toVisit.push(caps);
-
StringBuilder builder = new StringBuilder("Capabilities ");
abbreviate(seen, builder, caps);
return builder.toString();
