Icds { public Icd findByCode(String code) { return values.stream() .filter(v -> v.getCode().equals(code)) .findAny() .orElseThrow(() -> new IllegalArgumentException(String.format("Value '%s' is not valid ICD.", code))); } private  Icds(Icd[]... values); static Icds of(Icd[]... values); IcdIdentifier parse(String s); IcdIdentifier parse(ParticipantIdentifier participantIdentifier); IcdIdentifier parse(String icd, String identifier); Icd findBySchemeAndCode(Scheme scheme, String code); Icd findByIdentifier(String identifier); Icd findByCode(String code); List<Icd> values();  }
@Test public void simpleGetCode() { Assert.assertEquals(icds.findByCode("9908"), PeppolIcd.NO_ORGNR); }
@Test(expectedExceptions = IllegalArgumentException.class) public void simpleGetCodeException() { icds.findByCode("0000"); }