JsonFileResourceMetadataStatementsProvider implements MetadataStatementsProvider, InitializingBean { @Override public Map<AAGUID, Set<MetadataStatement>> provide() { checkConfig(); if (cachedMetadataItems == null) { cachedMetadataItems = resources.stream() .map(this::readJsonFile) .distinct() .collect(Collectors.groupingBy(this::extractAAGUID)) .entrySet().stream() .collect(Collectors.toMap(Map.Entry::getKey, entry -> new HashSet<>(entry.getValue()))); } return cachedMetadataItems; } JsonFileResourceMetadataStatementsProvider(ObjectConverter objectConverter); @Override void afterPropertiesSet(); @Override Map<AAGUID, Set<MetadataStatement>> provide(); List<Resource> getResources(); void setResources(List<Resource> resources);  }
@Test(expected = IllegalArgumentException.class) public void resources_not_configured_test() { target.provide(); }