### Question:
SimpleHashtable implements Iterable<TableEntry<K, V>> { public int getCapacity() { return table.length; } SimpleHashtable(); @SuppressWarnings("unchecked")  SimpleHashtable(int capacity); void put(K key, V value); V get(Object key); int size(); boolean containsKey(Object key); boolean containsValue(Object value); void remove(Object key); boolean isEmpty(); @Override String toString(); void clear(); int getCapacity(); @Override Iterator<TableEntry<K, V>> iterator(); static final int MINIMUM_CAPACITY; static final int DEFAULT_CAPACITY; }### Answer:
@Test void testConstructorWithNoArguments() { assertEquals(SimpleHashtable.DEFAULT_CAPACITY, new SimpleHashtable<Integer, String>().getCapacity()); }
@Test void testCapacityConstructorWithNonPowersOf2() { assertEquals(4, new SimpleHashtable<Object, Object>(3).getCapacity()); assertEquals(32, new SimpleHashtable<Object, Object>(25).getCapacity()); assertEquals(128, new SimpleHashtable<Object, Object>(127).getCapacity()); assertEquals(256, new SimpleHashtable<Object, Object>(129).getCapacity()); }
@Test void testCapacityConstructorWithPowersOf2() { assertEquals(1, new SimpleHashtable<Object, Object>(1).getCapacity()); assertEquals(2, new SimpleHashtable<Object, Object>(2).getCapacity()); assertEquals(4, new SimpleHashtable<Object, Object>(4).getCapacity()); assertEquals(32, new SimpleHashtable<Object, Object>(32).getCapacity()); assertEquals(256, new SimpleHashtable<Object, Object>(256).getCapacity()); }