public class Confusion { static class Wrapper { public final Wrapper wrapped; public String name; public Wrapper(Wrapper wrapped, String name) { this.wrapped = wrapped; this.name = name; } public Wrapper(Wrapper wrapped) { this(wrapped, null); } public Wrapper(String name) { this(null, name); } public boolean equals(Object o) { return (o instanceof Wrapper); } public int hashCode() { return 0; } } public static final Wrapper Wrapper1 = new Wrapper(new Wrapper("Wrapper1")); public static final Wrapper Wrapper2 = new Wrapper(new Wrapper("Wrapper2")); public static void main(String[] args) { System.out.println(Wrapper1.wrapped.name); System.out.println(Wrapper2.wrapped.name); } }