code: public static <T> Pair<Object, AerospikeRecord> getAerospikeRecordFromObject(T t) throws IllegalAccessException, InstantiationException,
              InvocationTargetException {
          Field[] fields = AnnotationUtils.filterDeepFields(t.getClass());
          Pair<Field[], Field[]> keysAndFields = AnnotationUtils.filterKeyFields(t.getClass());
          Field[] keys = keysAndFields.left;
  
          Object key;
          Map<String, Object> bins = new HashMap<>();
  
          if(keys.length == 0) {
              throw new InvocationTargetException(new Exception("One key field must be defined."));
          } else if(keys.length > 1) {
              throw new InvocationTargetException(new Exception("Aerospike only supports one key field"));
          } else {
              Field keyField = keys[0];
              Method method = Utils.findGetter(keyField.getName(), t.getClass());
              key = method.invoke(t);
          }
  
          for (Field field : fields) {
              Method method = Utils.findGetter(field.getName(), t.getClass());
              Object object = method.invoke(t);
              if (object != null) {
                  bins.put(AnnotationUtils.deepFieldName(field), object);
              }
          }
          Record record = new Record(bins, 0, 0);
          AerospikeRecord aerospikeRecord = new AerospikeRecord(record);
          Pair<Object, AerospikeRecord> result = Pair.create(key, aerospikeRecord);
          return result;
      }
docs: Converts from an entity class with deep's anotations to AerospikeRecord.
  
  @param t   an instance of an object of type T to convert to AerospikeRecord.
  @param <T> the type of the object to convert.
  @return A pair with the Record key and the Record itself.
  @throws IllegalAccessException
  @throws InstantiationException
  @throws InvocationTargetException