import ch.codeblock.qrinvoice.util.IbanUtils;
// ...
// When you use IbanUtils in order to validate IBAN numbers, you need to decide, whether the country code should be validated
// this is done using the 2nd parameter named "validateCountryCode"
// if set to true, the country code should be validated. If so, only "CH" and "LI" IBANs are allowed
// (the only supported IBANs are CH and LI for the QR Bill)
// if set to false, IBANs are validated without restriction on the country code
// you can validate IBANs in normalized format
System.out.println(IbanUtils.isValidIBAN("CH3908704016075473007", true));
// prints "true"
// or in formatted format, both is supported
System.out.println(IbanUtils.isValidIBAN("CH39 0870 4016 0754 7300 7", true));
System.out.println(IbanUtils.isValidIBAN("LI21 0881 0000 2324 013A A", true));
// prints "true"
// the following two lines show how to validate IBAN from Germany, Belgium and Malta
System.out.println(IbanUtils.isValidIBAN("DE89 3704 0044 0532 0130 00", false));
System.out.println(IbanUtils.isValidIBAN("BE68844010370034", false));
System.out.println(IbanUtils.isValidIBAN("MT98MMEB44093000000009027293051", false));
// prints "true"