### Question:
Facts implements Iterable<Fact<?>> { public <T> void add(Fact<T> fact) { Objects.requireNonNull(fact, "fact must not be null"); Fact<?> retrievedFact = getFact(fact.getName()); if (retrievedFact != null) { remove(retrievedFact); } facts.add(fact); }  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 testAdd() { Fact<Integer> fact1 = new Fact<>("foo", 1); Fact<Integer> fact2 = new Fact<>("bar", 2); facts.add(fact1); facts.add(fact2); assertThat(facts).contains(fact1); assertThat(facts).contains(fact2); }