Icds { public Icd findBySchemeAndCode(Scheme scheme, String code) { return values.stream() .filter(v -> v.getCode().equals(code) && v.getScheme().equals(scheme)) .findAny() .orElseThrow(() -> new IllegalArgumentException(String.format("Value '%s::%s' is not valid ICD.", scheme, 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 simpleUseOfGeneric() throws Exception { Assert.assertTrue(icds.findBySchemeAndCode(ICD_TT_ORGNR.getScheme(), ICD_TT_ORGNR.getCode()) == ICD_TT_ORGNR); }