### Question:
FHIRExtractors { public static String getOrganizationID(IBaseResource resource) { return resource.getMeta().getTag() .stream() .filter(tag -> tag.getSystem().equals(DPCIdentifierSystem.DPC.getSystem())) .map(IBaseCoding::getCode) .map(code -> new IdType(code).getIdPart()) .findFirst() .orElseThrow(() -> new IllegalArgumentException("Roster MUST have DPC organization tag")); } private  FHIRExtractors(); static String getProviderNPI(Practitioner provider); static String getPatientMBI(Patient patient); static String getPatientBeneId(Patient patient); static UUID getEntityUUID(String idString); static Provenance.ProvenanceAgentComponent getProvenancePerformer(Provenance provenance); static Identifier parseIDFromQueryParam(String queryParam); static Pair<String, String> parseTag(String tag); static Identifier findMatchingIdentifier(List<Identifier> identifiers, DPCIdentifierSystem system); static String getOrganizationID(IBaseResource resource); static String getAttributedNPI(Group group);  }### Answer:
@Test void testResourceNoMeta() { final Group group = new Group(); assertThrows(IllegalArgumentException.class, () -> getOrganizationID(group), "Should fail with missing meta"); }
@Test void testResourceWithMeta() { final Group group = new Group(); final Meta meta = new Meta(); group.setMeta(meta); assertThrows(IllegalArgumentException.class, () -> getOrganizationID(group), "Should fail with empty meta"); meta.addTag().setSystem(DPCIdentifierSystem.MBI_HASH.getSystem()).setCode("not-an-org"); assertThrows(IllegalArgumentException.class, () -> getOrganizationID(group), "Should fail with incorrect identifier"); meta.addTag().setSystem(DPCIdentifierSystem.DPC.getSystem()).setCode("test-org"); assertEquals("test-org", getOrganizationID(group), "Should have correct org ID"); }