### Question:
CompartmentUtil { public static final Map<String, CompartmentCache> buildCompartmentMap() { Map<String, CompartmentCache> cachedCompartmentMap = compartmentMap; if (cachedCompartmentMap == null) { cachedCompartmentMap = new HashMap<>(); try (InputStreamReader reader = new InputStreamReader(CompartmentUtil.class.getResourceAsStream(RESOURCE))) { Bundle bundle = FHIRParser.parser(Format.JSON).parse(reader); FHIRPathEvaluator evaluator = FHIRPathEvaluator.evaluator(); EvaluationContext evaluationContext = new EvaluationContext(bundle); Collection<FHIRPathNode> result = evaluator.evaluate(evaluationContext, FHIR_PATH_BUNDLE_ENTRY); Iterator<FHIRPathNode> iter = result.iterator(); while (iter.hasNext()) { FHIRPathResourceNode node = iter.next().asResourceNode(); CompartmentDefinition compartmentDefinition = node.resource().as(CompartmentDefinition.class); CompartmentCache compartmentDefinitionCache = new CompartmentCache(); for (Resource resource : compartmentDefinition.getResource()) { String inclusionCode = resource.getCode().getValue(); List<com.ibm.fhir.model.type.String> params = resource.getParam(); if (!params.isEmpty()) { compartmentDefinitionCache.add(inclusionCode, params); } } String codeCacheName = compartmentDefinition.getCode().getValue(); cachedCompartmentMap.put(codeCacheName, compartmentDefinitionCache); } cachedCompartmentMap = Collections.unmodifiableMap(cachedCompartmentMap); } catch (FHIRException e) { log.warning(String.format(PARSE_EXCEPTION, FROM_STREAM)); } catch (IOException e1) { log.warning(String.format(IO_EXCEPTION, FROM_STREAM)); } } return cachedCompartmentMap; } private  CompartmentUtil(); static void init(); static final Map<String, CompartmentCache> buildCompartmentMap(); static List<String> getCompartmentResourceTypes(final String compartment); static List<String> getCompartmentResourceTypeInclusionCriteria(final String compartment, final String resourceType); static void checkValidCompartment(final String compartment); static void checkValidCompartmentAndResource(final String compartment, final String resourceType); static void buildCompositeBundle(PrintStream out); static final String FHIR_PATH_BUNDLE_ENTRY; static final String RESOURCE; static final String PARSE_EXCEPTION; static final String IO_EXCEPTION; static final String INVALID_COMPARTMENT; static final String INVALID_COMPARTMENT_AND_RESOURCE; static final String FROM_STREAM; }### Answer:
@Test() public void testBuildCompartmentMap() { Map<String, CompartmentCache> cache = CompartmentUtil.buildCompartmentMap(); assertEquals(5, cache.keySet().size()); }
@Test(expectedExceptions = { UnsupportedOperationException.class }, dependsOnMethods = { "testBuildCompartmentMap" }) public void testBuildCompartmentMapWithModification() { Map<String, CompartmentCache> cache = CompartmentUtil.buildCompartmentMap(); cache.clear(); }