code: private UnitValue consumption(UnitValue value, Unit target) {
      BigDecimal amt = value.amount();
      Unit unit = value.unit();
      if (unit == target) {
        return value;
      }
      
      boolean uk = measurementSystem == MeasurementSystem.UK;
      if (uk && unit == Unit.MILE_PER_GALLON && target == Unit.MILE_PER_GALLON_IMPERIAL) {
        return value;
      }
      
      BigDecimal result = null;
  
      switch (unit) {
        case MILE_PER_GALLON:
        case MILE_PER_GALLON_IMPERIAL:
          switch (target) {
            case LITER_PER_KILOMETER:
            case LITER_PER_100KILOMETERS:
              result = litersToMpg(target, unit, amt);
              break;
            
            case MILE_PER_GALLON:
              result = USGAL_PER_UKGAL.multiply(new Rational(amt, BigDecimal.ONE)).compute();
              break;
              
            case MILE_PER_GALLON_IMPERIAL:
              result = UKGAL_PER_USGAL.multiply(new Rational(amt, BigDecimal.ONE)).compute();
              break;
              
            default:
              break;
          }
          break;
          
        case LITER_PER_KILOMETER:
        case LITER_PER_100KILOMETERS:
          switch (target) {
            case MILE_PER_GALLON:
            case MILE_PER_GALLON_IMPERIAL:
              result = litersToMpg(unit, target, amt);
              break;
              
            case LITER_PER_100KILOMETERS:
              result = new Rational(amt, BigDecimal.ONE).multiply(ONE_HUNDRED).compute();
              break;
              
            case LITER_PER_KILOMETER:
              result = new Rational(amt, BigDecimal.ONE).multiply(ONE_HUNDREDTH).compute();
              break;
              
            default:
              break;
          }
          break;
          
        default:
          break;
      }
      
      if (result != null) {
        return new UnitValue(result, target);
      }
      
      return value;
    }
docs: Convert between MPG and L/100KM.