code: public static FightType getFightType(Sherdog parser, Fight fight) {
  
          //getting one of the fighter, and parsing his/her fights to find this fight
  
          BiFunction<SherdogBaseObject, SherdogBaseObject, FightType> getType = (f1, f2) -> {
              try {
                  Fighter fighter = parser.getFighter(f1.getSherdogUrl());
                  return fighter
                          .getFights()
                          .stream()
                          .filter(f -> f.getResult() != FightResult.NOT_HAPPENED)
                          .filter(f -> f.getFighter2() != null)
                          .filter(f -> f.getFighter2().getSherdogUrl().equalsIgnoreCase(f2.getSherdogUrl()) && f.getEvent().getSherdogUrl().equalsIgnoreCase(fight.getEvent().getSherdogUrl()))
                          .findFirst()
                          .map(Fight::getType)
                          .orElse(FightType.PRO); //if we don't know, assume pro
              } catch (Exception e) {
                  e.printStackTrace();
                  return FightType.PRO; //if we dont know assume pro
              }
          };
  
          if (fight.getResult() == FightResult.NOT_HAPPENED) {
              return FightType.UPCOMING;
          }
  
          Optional<SherdogBaseObject> fighter = Optional.of(fight)
                  .map(Fight::getFighter1)
                  .filter(f -> f.getSherdogUrl() != null && f.getSherdogUrl().length() > 0);
  
          if (fighter.isPresent()) {
              return getType.apply(fighter.get(), fight.getFighter2());
          } else {
              return getType.apply(fight.getFighter2(), fight.getFighter1());
          }
  
  
      }
docs: Gets the type of a fight (Pro, amateur etc...)
  
  @param parser the sherdsog parser, required as we need to use the parser to get info on the fighter
  @param fight  the fight to check
  @return the type of the fight