### Question:
ClassToInstanceStore { public void putAll(ClassToInstanceStore<? extends T> toCopy) { this.backingMap.putAll(toCopy.backingMap); }  @SafeVarargs static ClassToInstanceStore<T> create(T... instances); Optional<U> getInstance(Class<U> clazz); Optional<U> putInstance(Class<? extends U> clazz, U instance); Optional<U> removeInstance(Class<U> clazz); void putAll(ClassToInstanceStore<? extends T> toCopy); boolean containsKey(Class<? extends T> clazz); boolean isEmpty(); @SuppressWarnings("unchecked") Optional<U> putInstance(U instance); Collection<T> values(); Collection<Class<? extends T>> keys(); @Override String toString();  }### Answer:
@Test public void putAll() { ClassToInstanceStore<Object> ctim = new ClassToInstanceStore<>(); String first = "a String"; String second = "a second String"; ctim.putInstance(CharSequence.class, first); ctim.putInstance(String.class, second); ClassToInstanceStore<Object> copy = new ClassToInstanceStore<>(); copy.putAll(ctim); assertThat(copy.getInstance(CharSequence.class).get(), is(first)); assertThat(copy.getInstance(String.class).get(), is(second)); }