code: private static void getFieldHelper(Map<String, Object> retVal,
        Object data, List<String> pathList, int field) {
      if (data == null) {
        return;
      }
  
      if ((field + 1) == pathList.size()) {
        Object val = null;
        Joiner joiner = Joiner.on(".");
        String key = joiner.join(pathList.iterator());
  
        if (data instanceof Map) {
          val = getObjectFromMap((Map)data, pathList.get(field));
        } else if (data instanceof List) {
          val = getObjectFromArray((List)data, Integer.parseInt(pathList.get(field)));
        } else {
          val = ((Record)data).get(pathList.get(field));
        }
  
        if (val != null) {
          retVal.put(key, val);
        }
  
        return;
      }
      if (data instanceof Map) {
        AvroUtils.getFieldHelper(retVal, getObjectFromMap((Map) data, pathList.get(field)), pathList, ++field);
        return;
      }
      if (data instanceof List) {
        if (pathList.get(field).trim().equals("*")) {
          List arr = (List)data;
          Iterator it = arr.iterator();
          int i = 0;
          while (it.hasNext()) {
            Object val = it.next();
            List<String> newPathList = new ArrayList<>(pathList);
            newPathList.set(field, String.valueOf(i));
            AvroUtils.getFieldHelper(retVal, val, newPathList, field + 1);
            i++;
          }
        } else {
          AvroUtils
              .getFieldHelper(retVal, getObjectFromArray((List) data, Integer.parseInt(pathList.get(field))), pathList, ++field);
        }
        return;
      }
  
      AvroUtils.getFieldHelper(retVal, ((Record) data).get(pathList.get(field)), pathList, ++field);
      return;
    }
docs: Helper method that does the actual work for {@link #getFieldValue(GenericRecord, String)}
  @param data passed from {@link #getFieldValue(GenericRecord, String)}
  @param pathList passed from {@link #getFieldValue(GenericRecord, String)}
  @param field keeps track of the index used to access the list pathList
  @return the value of the field