### Question:
LongIntHashtable implements Serializable { public LongIntHashtable() { this(3); } LongIntHashtable();  LongIntHashtable(int capacity); void put(long key, int value); int get(long key); boolean remove(long key); void removeAll(); boolean contains(long key); int size(); long[] getKeys();  }### Answer:
@Test public void testLongIntHashtable() { LongIntHashtable ht = new LongIntHashtable(); System.out.println("Test put method"); ht.put(10000, 100); ht.put(20000, 200); ht.put(30000, 300); ht.put(40000, 400); test(ht, 10000, 100); test(ht, 20000, 200); test(ht, 30000, 300); test(ht, 40000, 400); try { int value = ht.get(50000); Assert.fail("The value "+value+" was found at key "+ "50000, but there should not have been a value there."); } catch(NoValueException ex) { } System.out.println("Test contains method"); testContains(ht, new long[]{10000,20000,30000,40000}, "Add"); System.out.println("Test size method"); if (ht.size() != 4) { Assert.fail("size should be 4, but it is "+ht.size()); } System.out.println("Test remove"); ht.remove(20000); if (ht.size() != 3) { Assert.fail("size should be 3, but it is "+ht.size()); } testContains(ht, new long[]{10000,30000,40000}, "Remove"); System.out.println("Test removeAll"); ht.removeAll(); if (ht.size() != 0) { Assert.fail("size should be 0, but it is "+ht.size()); } testContains(ht,new long[]{}, "RemoveAll"); System.out.println("Test grow by adding 500 values"); for(int i=0;i<500;i++) { ht.put(i*100, i); } for(int i= 0;i<50000;i++) { if (ht.contains(i)) { if (i%100 != 0) { Assert.fail("hashtable contains key "+i+", but it shouldn't"); } } else { if (i%100 == 0) { Assert.fail("hashtable should contain key "+i+", but it doesn't"); } } } }