SwiftCodeService { public SwiftCode getSwiftCode(String code) { SwiftCode swiftCode = null; if (code.length() >= 6) { String countryCode = code.substring(4, 6); SwiftCountry country = getCountry(countryCode); if (country != null) { swiftCode = country.get(code); } } else { swiftCode = null; } return swiftCode; }  SwiftCountry loadCountry(String countryCode); SwiftCode getSwiftCode(String code); SwiftCountry getCountry(String countryCode);  }
@Test public void testGetSwiftCode() { SwiftCode swiftCode = service.getSwiftCode("BACAADAD"); assertNotNull(swiftCode); assertEquals("BACAADAD", swiftCode.getCode()); }