### Question:
Key { @Override public int hashCode() { int hashCode = 407 + 11 * typeLiteral.hashCode(); if (bindingName != null) { hashCode += bindingName.hashCode(); } return hashCode; } protected  Key(TypeLiteral<T> type, String bindingName); static Key<T> get(Class<T> type); static Key<T> get(Class<T> type, String bindingName); static Key<List<T>> getListOf(Class<T> type); static Key<List<T>> getListOf(Class<T> type, String bindingName); static Key<Map<K, V>> getMapOf(Class<K> keyType, Class<V> valueType); static Key<Map<K, V>> getMapOf(Class<K> keyType, Class<V> valueType, String bindingName); @SuppressWarnings("unchecked") Class<T> getType(); String getBindingName(); @Override boolean equals(Object object); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testHashCode() { Key<String> key1 = Key.get(String.class); Key<String> key2 = Key.get(String.class); Key<Integer> key3 = Key.get(Integer.class); Key<Integer> key4 = Key.get(Integer.class, "a"); Key<Integer> key5 = Key.get(Integer.class, "a"); Key<Integer> key6 = Key.get(Integer.class, "b"); Key<String> key7 = Key.get(String.class, "a"); assertTrue( "generated different hashcode on second inocation", key1.hashCode() == key1.hashCode()); assertTrue(key1.hashCode() == key2.hashCode()); assertTrue(key4.hashCode() == key5.hashCode()); assertFalse(key1.hashCode() == key3.hashCode()); assertFalse(key4.hashCode() == key3.hashCode()); assertFalse(key5.hashCode() == key6.hashCode()); assertFalse(key7.hashCode() == key4.hashCode()); }