### Question:
Facts implements Iterable<Fact<?>> { public <T> void put(String name, T value) { Objects.requireNonNull(name, "fact name must not be null"); Objects.requireNonNull(value, "fact value must not be null"); Fact<?> retrievedFact = getFact(name); if (retrievedFact != null) { remove(retrievedFact); } add(new Fact<>(name, value)); }  void put(String name, T value); void add(Fact<T> fact); void remove(String factName); void remove(Fact<T> fact); @SuppressWarnings("unchecked") T get(String factName); Fact<?> getFact(String factName); Map<String, Object> asMap(); @Override Iterator<Fact<?>> iterator(); void clear(); @Override String toString();  }### Answer:
@Test public void testPut() { facts.put("foo", 1); facts.put("bar", 2); assertThat(facts).contains(new Fact<>("foo", 1)); assertThat(facts).contains(new Fact<>("bar", 2)); }