CompositeGenotype implements Genotype, Iterable<Entry<K, V>> { public void clear() { map.clear(); } CompositeGenotype();  CompositeGenotype(Map<K, V> map); @Override int size(); @SuppressWarnings("unchecked") G get(Object key); void put(K key, V value); void clear(); Set<K> keySet(); Collection<V> values(); @Override Iterator<Entry<K, V>> iterator(); @Override @SuppressWarnings("unchecked") G newInstance(); @Override String toString();  }
@Test public void clear() { CompositeGenotype<String, Genotype> composite = new CompositeGenotype<String, Genotype>(); IntegerGenotype one = new IntegerGenotype(0, 2); one.add(1); composite.put("one", one); composite.put("two", new IntegerGenotype(0, 2)); Assert.assertEquals(1, composite.size()); composite.clear(); Assert.assertEquals(0, composite.size()); }