code: private List<?> joinFeatures(List<?> list) {
          List result = new ArrayList<Object>();
  
          for (Object object : list) {
              int start = -1;
              int end = -1;
  
              if (object instanceof Gene) {
                  result.add(object);
                  start = ((Gene) object).getStart();
                  end = ((Gene) object).getEnd();
              }
  
              if (object instanceof RegulatoryRegion) {
                  result.add(object);
                  start = ((RegulatoryRegion) object).getStart();
                  end = ((RegulatoryRegion) object).getEnd();
              }
  
              if (object instanceof List) {
                  result.addAll(joinFeatures((List) object));
              }
  
              /* Acutualizamos los valores maximo de end y minimo de start */
              if ((start != -1) && (start < min_start)) {
                  min_start = start;
              }
  
              if ((end != -1) && (end > max_end)) {
                  max_end = end;
              }
          }
  
          return result;
      }
docs: De una list<Object> o una List<List<Object>> coge todas las features y las mete en la misma estructura de datos.