@Test
public void testPut() throws Exception {

  TableAdapter primaryTable = createMock(TableAdapter.class);
  Client c = PowerMock.createPartialMock(Client.class, "getIndices",
      "getDatabaseAdapter");
  CKeyValue keyValue = new CKeyValue("rowid".getBytes(), "f".getBytes(),
      "q".getBytes(), "v".getBytes());
  ArrayList<CKeyValue> keyValueList = new ArrayList<CKeyValue>();
  keyValueList.add(keyValue);
  // used for main test and for setup
  Put put = new Put(keyValueList);
  Put put2 = new Put(keyValue);
  put.hashCode();
  put2.equals("");
  // MOCKING
  // mock out the index
  Index mockIndex = EasyMock.createMock(Index.class);
  EasyMock.expect(c.getIndices()).andReturn(new Index[] { mockIndex });
  EasyMock.expect(mockIndex.getColumnFamily()).andReturn("f".getBytes());
  EasyMock.expect(mockIndex.getColumnQualifier()).andReturn("q".getBytes());
  mockIndex.handlePut(EasyMock.anyObject(Put.class));
  // mock out the db
  DatabaseAdapter databaseAdapter = EasyMock
      .createMock(DatabaseAdapter.class);
  EasyMock.expect(databaseAdapter.verify()).andReturn(true);
  PowerMock.expectPrivate(c, "getDatabaseAdapter").andReturn(databaseAdapter);
  EasyMock.expect(databaseAdapter.getTableAdapter("foo")).andReturn(
      primaryTable);
  primaryTable.put(put);
  PowerMock.replayAll(mockIndex, primaryTable, databaseAdapter);
  c.put("foo", put);
  // c.createRecord(recordID, sourceID, fieldValues);
  EasyMock.verify(primaryTable);
}