### Question:
HashtableGenerator extends MapGenerator<Hashtable> { @Override protected boolean okToAdd(Object key, Object value) { return key != null && value != null; } HashtableGenerator(); @Override void addComponentGenerators(List<Generator<?>> newComponents);  }### Answer:
@Test public void disallowsNullKeyAndNullValue() { assertFalse(generator.okToAdd(null, null)); }
@Test public void disallowsNullKey() { assertFalse(generator.okToAdd(null, new Object())); }
@Test public void disallowsNullValue() { assertFalse(generator.okToAdd(new Object(), null)); }
@Test public void allowsKeyAndValueWhenNeitherIsNull() { assertTrue(generator.okToAdd(new Object(), new Object())); }