### Question:
EntityKey { @Override public int hashCode() { return Objects.hash(entityMetamodel, items); } EntityKey(EntityMetamodel<?> entityMetamodel, List<?> items); EntityMetamodel<?> getEntityMetamodel(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test void testHashCode() { EntityKey key1 = new EntityKey(entityDef, Arrays.asList("a", 1)); EntityKey key2 = new EntityKey(entityDef, Arrays.asList("a", 1)); assertEquals(key1.hashCode(), key2.hashCode()); }
@Test void testHashCode_empty() { EntityKey key1 = new EntityKey(entityDef, new ArrayList<>()); EntityKey key2 = new EntityKey(entityDef, new ArrayList<>()); assertEquals(key1.hashCode(), key2.hashCode()); }
@Test void testHashCode_nulls() { EntityKey key1 = new EntityKey(entityDef, Arrays.asList(null, null)); EntityKey key2 = new EntityKey(entityDef, Arrays.asList(null, null)); assertEquals(key1.hashCode(), key2.hashCode()); }
@Test void testNotEquals_notEquals() { EntityKey key1 = new EntityKey(entityDef, Arrays.asList("a", 1)); EntityKey key2 = new EntityKey(entityDef, Arrays.asList("a", 2)); assertNotEquals(key1, key2); assertNotEquals(key1.hashCode(), key2.hashCode()); }