### Question:
Key { @Override public boolean equals(Object object) { if (object == this) { return true; } if (object instanceof Key<?>) { Key<?> key = (Key<?>) object; if (!typeLiteral.equals(key.typeLiteral)) { return false; } if (bindingName != null) { return bindingName.equals(key.bindingName); } else { return key.bindingName == null; } } return false; } 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 testEquals() { Key<String> key1 = Key.get(String.class); Key<String> key2 = Key.get(String.class); Key<Integer> key3 = Key.get(Integer.class); Key<Integer> key31 = 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(key1.equals(key2)); assertFalse(key1.equals(key3)); assertTrue(key3.equals(key31)); assertTrue(key31.equals(key3)); assertFalse(key3.equals(key4)); assertFalse(key4.equals(key3)); assertTrue(key4.equals(key5)); assertTrue(key5.equals(key4)); assertFalse(key5.equals(key6)); assertFalse(key6.equals(key5)); assertFalse(key4.equals(key7)); assertFalse(key7.equals(key4)); }