### Question:
ObjectKeyIndexer { public ObjectKeyIndexer() { this(DEFAULT_CAPACITY); } ObjectKeyIndexer(); @SuppressWarnings("unchecked")  ObjectKeyIndexer(int capacity); int put(T key); int get(Object key); int remove(Object key); int getSize(); int getCapacity(); void clear(); @SuppressWarnings("unchecked") T[] getKeys(T[] keyArray);  }### Answer:
@Test public void testObjectKeyIndexer() { ObjectKeyIndexer<String> indexer = new ObjectKeyIndexer<>(13); System.out.println("Test put method"); int index; index = indexer.put("A"); if (index != 0) { Assert.fail("Put: expected 0, got "+index); } index = indexer.put("B"); if (index != 1) { Assert.fail("Put: expected 1, got "+index); } index = indexer.put("C"); if (index != 2) { Assert.fail("Put: expected 2, got "+index); } index = indexer.put("D"); if (index != 3) { Assert.fail("Put: expected 3, got "+index); } index = indexer.put("E"); if (index != 4) { Assert.fail("Put: expected 4, got "+index); } index = indexer.put("F"); if (index != 5) { Assert.fail("Put: expected 5, got "+index); } index = indexer.put("G"); if (index != 6) { Assert.fail("Put: expected 6, got "+index); } index = indexer.put("B"); if (index != 1) { Assert.fail("Put: expected 1, got "+index); } System.out.println("Test remove method"); indexer.remove("D"); index = indexer.get("D"); if (index != -1) { Assert.fail("Expected to get -1 on remove of " + "non-existent index and instead got "+index); } index = indexer.put("Z"); if (index != 3) { Assert.fail("Remove: expected 3, got "+index); } System.out.println("Test grow"); for(int i=0;i<20;i++) { indexer.put("LAB"+i); } index = indexer.get("A"); if (index != 0) { Assert.fail("Grow: expected 0, got "+index); } index = indexer.get("B"); if (index != 1) { Assert.fail("Grow: expected 1, got "+index); } index = indexer.get("C"); if (index != 2) { Assert.fail("Grow: expected 2, got "+index); } index = indexer.get("D"); if (index != -1) { Assert.fail("Grow: expected 3, got "+index); } index = indexer.get("E"); if (index != 4) { Assert.fail("Grow: expected 4, got "+index); } index = indexer.get("F"); if (index != 5) { Assert.fail("Grow: expected 5, got "+index); } index = indexer.get("G"); if (index != 6) { Assert.fail("Grow: expected 6, got "+index); } index = indexer.get("LAB"+0); if (index != 7) { Assert.fail("Grow: expected 7, got "+index); } index = indexer.get("M"); if (index != -1) { Assert.fail("Grow: expected -1, got "+index); } System.out.println("Test capacity"); if (indexer.getCapacity() != 37) { Assert.fail("Capacity should be 37, but it is "+indexer.getCapacity()); } indexer.clear(); for(int i=0;i<100;i++) { indexer.put("LAB"+i); } for(int i=0;i<100;i++) { if (indexer.get("LAB"+i) != i) { Assert.fail("Sequence: expected "+i+", and got"+indexer.get("LAB"+i)); } } }