### Question:
Key { public static <T> Key<T> get(Class<T> type) { return get(TypeLiteral.of(type)); } protected  Key(TypeLiteral<T> type, String bindingName); protected  Key(TypeLiteral<T> type, Class<? extends Annotation> annotationType); protected  Key(TypeLiteral<T> type, Annotation annotationInstance); static Key<T> get(Class<T> type); static Key<T> get(Class<T> type, String bindingName); static Key<T> get(Class<T> type, Class<? extends Annotation> annotationType); static Key<T> get(Class<T> type, Annotation annotationInstance); static Key<T> get(TypeLiteral<T> typeLiteral); static Key<T> get(TypeLiteral<T> typeLiteral, String bindingName); static Key<T> get(TypeLiteral<T> typeLiteral, Class<? extends Annotation> annotationType); static Key<T> get(TypeLiteral<T> typeLiteral, Annotation annotationInstance); static Key<List<T>> getListOf(Class<T> type, Class<? extends Annotation> qualifier); static Key<List<T>> getListOf(Class<T> type, String bindingName); static Key<List<T>> getListOf(Class<T> type); static Key<Set<T>> getSetOf(Class<T> valueType, Class<? extends Annotation> qualifier); static Key<Set<T>> getSetOf(Class<T> valueType, String bindingName); static Key<Set<T>> getSetOf(Class<T> valueType); static Key<Map<K, V>> getMapOf(Class<K> keyType, Class<V> valueType, Class<? extends Annotation> qualifier); static Key<Map<K, V>> getMapOf(Class<K> keyType, Class<V> valueType, String bindingName); static Key<Map<K, V>> getMapOf(Class<K> keyType, Class<V> valueType); static Key<Map<K, V>> getMapOf(TypeLiteral<K> keyType, TypeLiteral<V> valueType, Class<? extends Annotation> qualifier); static Key<Map<K, V>> getMapOf(TypeLiteral<K> keyType, TypeLiteral<V> valueType, String bindingName); static Key<Map<K, V>> getMapOf(TypeLiteral<K> keyType, TypeLiteral<V> valueType); static Key<Optional<T>> getOptionalOf(Class<? extends T> type); static Key<Optional<T>> getOptionalOf(Key<T> key); TypeLiteral<T> getType(); String getBindingName(); Class<? extends Annotation> getBindingAnnotation(); @Override boolean equals(Object object); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testQualifiedKeysEquals() { Key<Integer> key1 = Key.get(Integer.class, CustomQualifier.class); Key<Integer> key2 = Key.get(Integer.class); Key<Integer> key3 = Key.get(Integer.class, CustomQualifier.class); Key<String> key4 = Key.get(String.class, CustomQualifier.class); assertEquals(key1, key3); assertNotEquals(key1, key2); assertNotEquals(key1, key4); Key<Map<String, List<? extends Number>>> key5 = Key.get(new TypeLiteral<Map<String, List<? extends Number>>>(){}, CustomQualifier.class); Key<Map<String, List<? extends Number>>> key6 = Key.get(new TypeLiteral<Map<String, List<? extends Number>>>(){}, CustomQualifier.class); Key<Map<String, List<? extends Object>>> key7 = Key.get(new TypeLiteral<Map<String, List<? extends Object>>>(){}, CustomQualifier.class); assertEquals(key5, key6); assertNotEquals(key5, key7); }
@Test public void testBaseEquals() { Key<String> key1 = Key.get(String.class); Key<String> key2 = key1; Object key3 = new Object(); assertEquals(key1, key2); assertEquals(key2, key1); assertNotEquals(key1, key3); }