code: public static void validate(final String iban, final IbanFormat format) throws IbanFormatException,
              InvalidCheckDigitException, UnsupportedCountryException {
          switch (format) {
              case Default:
                  final String ibanWithoutSpaces = iban.replace(" ", "");
                  validate(ibanWithoutSpaces);
                  if(!toFormattedString(ibanWithoutSpaces).equals(iban)) {
                      throw new IbanFormatException(IBAN_FORMATTING,
                              String.format("Iban must be formatted using 4 characters and space combination. " +
                                      "Instead of [%s]", iban));
                  }
                  break;
              default:
                  validate(iban);
                  break;
          }
      }
docs: Validates iban.
  
  @param iban to be validated.
  @param format to be used in validation.
  @throws IbanFormatException if iban is invalid.
  UnsupportedCountryException if iban's country is not supported.
  InvalidCheckDigitException if iban has invalid check digit.