### Question:
ASTScalar extends SimpleNode { @Override public int hashCode() { return value != null ? value.hashCode() : 0; } ASTScalar(int id);  ASTScalar();  ASTScalar(Object value); @Override Expression shallowCopy(); @Override void appendAsString(Appendable out); @Override void appendAsEJBQL(List<Object> parameterAccumulator, Appendable out, String rootId); void setValue(Object value); Object getValue(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testHashCode() throws Exception { ASTScalar strScalar1 = new ASTScalar("test"); ASTScalar strScalar2 = new ASTScalar("test"); assertEquals(strScalar1.hashCode(), strScalar2.hashCode()); ASTScalar nullScalar1 = new ASTScalar(null); ASTScalar nullScalar2 = new ASTScalar(null); assertEquals(nullScalar1.hashCode(), nullScalar2.hashCode()); assertNotEquals(strScalar1.hashCode(), nullScalar1.hashCode()); }