### Question:
Enum implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof Enum)) return false; Enum enm = (Enum)obj; return enm.name.equals(name); } protected  Enum(String name); String getName(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testEquals() { Enum enum1 = new Enum("enum1") { private static final long serialVersionUID = 1L; }; Enum enum2 = new Enum("enum1") { private static final long serialVersionUID = 1L; }; Enum enum3 = new Enum("enum3") { private static final long serialVersionUID = 1L; }; assertEquals(enum1, enum1); assertEquals(enum1, enum2); assertEquals(enum2, enum1); assertFalse(enum1.equals(enum3)); assertFalse(enum3.equals(enum1)); assertFalse(enum1.equals(null)); assertFalse(enum1.equals("enum1")); }