### Question:
HierarchicalName { @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof HierarchicalName)) { return false; } HierarchicalName hn = (HierarchicalName) obj; return hn.m_is_absolute == m_is_absolute && hn.m_names.equals(m_names); } HierarchicalName(boolean absolute, List<String> names);  HierarchicalName(boolean absolute, String... names); boolean absolute(); String peek(); HierarchicalName pop_first(); boolean leaf(); HierarchicalName push(String name); HierarchicalName make_absolute(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void compare_to_invalid() throws Exception { HierarchicalName hn = new HierarchicalName(false, "foo"); assertFalse(hn.equals((Object) null)); assertFalse(hn.equals(23)); }