### Question:
UtilAerospike { public static <T> T getObjectFromAerospikeRecord(Class<T> classEntity, AerospikeRecord aerospikeRecord, AerospikeDeepJobConfig aerospikeConfig) throws IllegalAccessException, InstantiationException, InvocationTargetException { Tuple2<String, Object> equalsFilter = aerospikeConfig.getEqualsFilter(); String equalsFilterBin = equalsFilter != null ? equalsFilter._1() : null; Object equalsFilterValue = equalsFilter != null ? equalsFilter._2() : null; Map<String, Object> bins = aerospikeRecord.bins; T t = classEntity.newInstance(); if (equalsFilter == null || checkEqualityFilter(bins, equalsFilterBin, equalsFilterValue)) { Field[] fields = AnnotationUtils.filterDeepFields(classEntity); Object insert = null; List<String> inputColumns = null; if (aerospikeConfig.getInputColumns() != null) { inputColumns = Arrays.asList(aerospikeConfig.getInputColumns()); } for (Field field : fields) { if (inputColumns != null && !inputColumns.contains(AnnotationUtils.deepFieldName(field))) { continue; } Object currentBin = null; Method method = null; Class<?> classField = field.getType(); try { method = Utils.findSetter(field.getName(), classEntity, field.getType()); currentBin = bins.get(AnnotationUtils.deepFieldName(field)); if (currentBin != null) { if (currentBin instanceof Integer && classField.equals(Long.class)) { currentBin = new Long((Integer) currentBin); } if (currentBin instanceof String || currentBin instanceof Integer || currentBin instanceof Long) { insert = currentBin; } else { throw new DeepGenericException("Data type [" + classField.toString() + "] not supported in Aerospike entity extractor (only Strings and Integers)"); } method.invoke(t, insert); } } catch (IllegalAccessException | InvocationTargetException | IllegalArgumentException e) { LOG.error("impossible to create a java object from Bin:" + field.getName() + " and type:" + field.getType() + " and value:" + t + "; recordReceived:" + currentBin); method.invoke(t, Utils.castNumberType(insert, classField)); } } } return t; } 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 testGetObjectFromRecord() throws UnknownHostException, NoSuchFieldException, IllegalAccessException, InvocationTargetException, InstantiationException { Map<String, Object> bins = new HashMap<>(); bins.put("id", "3"); bins.put("message", "Message"); bins.put("number", 3L); Record data = new Record(bins, 0, 0); AerospikeRecord record = new AerospikeRecord(data); MessageTestEntity messageEntity = UtilAerospike.getObjectFromAerospikeRecord(MessageTestEntity.class, record, new AerospikeDeepJobConfig(MessageTestEntity.class)); assertEquals(messageEntity.getId(), bins.get("id")); assertEquals(messageEntity.getMessage(), bins.get("message")); }