### Question:
UtilAerospike { public static Pair<Object, AerospikeRecord> getAerospikeRecordFromCell(Cells cells) throws IllegalAccessException, InstantiationException, InvocationTargetException { Map<String, Object> bins = new HashMap<>(); Object key = null; for (Cell cell : cells.getCells()) { if(key == null) { if(cell.isKey()) { key = cell.getValue(); } } else { if(cell.isKey()) { throw new InvocationTargetException(new Exception("Aerospike records must have only one key")); } } bins.put(cell.getCellName(), cell.getValue()); } if(key == null) { throw new InvocationTargetException(new Exception("Aerospike records must have one primary key")); } Record record = new Record(bins, 0, 0); return Pair.create(key, new AerospikeRecord(record)); } private  UtilAerospike(); static T getObjectFromAerospikeRecord(Class<T> classEntity, AerospikeRecord aerospikeRecord,
                                                     AerospikeDeepJobConfig aerospikeConfig); static Pair<Object, AerospikeRecord> getAerospikeRecordFromObject(T t); static Cells getCellFromAerospikeRecord(AerospikeKey key, AerospikeRecord aerospikeRecord,
                                                   AerospikeDeepJobConfig aerospikeConfig); static Pair<Object, AerospikeRecord> getAerospikeRecordFromCell(Cells cells);  }### Answer:
@Test public void testGetCellFromRecord() throws InstantiationException, IllegalAccessException, InvocationTargetException { Cells cells = new Cells(); cells.add(Cell.create("id", "1", true)); cells.add(Cell.create("message", "message", false)); Pair<Object, AerospikeRecord> record = UtilAerospike.getAerospikeRecordFromCell(cells); Map<String, Object> bins = record.right.bins; Object key = record.left; assertEquals(cells.getString("id"), key.toString()); assertEquals(cells.size(), bins.size()); assertEquals(cells.getString("id"), bins.get("id")); assertEquals(cells.getString("message"), bins.get("message")); }