@Test
public void ensureReadingExtensionsProducesCorrectListOfExtensions() {

    final StringReader file = new StringReader("#hello\n    World");
    final ExtensionAnnotationProcessor processor = mock(ExtensionAnnotationProcessor.class);
    final Map<String, Set<String>> extensions = new HashMap<>();
    extensions.put("hello", Collections.singleton("world"));
    given(processor.getExtensions()).willReturn(extensions);
    ServiceProviderExtensionStorage extensionStorage = new ServiceProviderExtensionStorage(processor) {
        @Override
        protected Filer getFiler() {
            try {
                Filer filer = mock(Filer.class);
                FileObject fileObject = mock(FileObject.class);
                given(fileObject.openReader(true)).willReturn(file);
                given(filer.getResource(
                    any(StandardLocation.class),
                    any(String.class),
                    any(String.class)
                )).willReturn(fileObject);
                return filer;
            } catch(IOException ex) {
                throw new IllegalStateException("Shouldn't have gotten here");
            }
        }
    };
    Map<String, Set<String>> read = extensionStorage.read();
    assertThat(read.containsKey("hello"), is(true));
    assertThat(read.get("hello"), is(Collections.singleton("World")));
}