@Override
    public void processResource(EfestoCompilationContext context, EfestoResource... toProcess) {
        for (EfestoResource efestoResource : toProcess) {
            processResourceWithContext(efestoResource, context);
        }
    }
@Test
    void overwritingIndexFile() {
        IndexFile indexFile = null;

        // 1st round
        try {
            EfestoCompilationContext context = EfestoCompilationContextUtils.buildWithParentClassLoader(CompilationManager.class.getClassLoader());
            List<AbstractMockOutput> toProcess = new ArrayList<>();
            toProcess.add(new MockEfestoRedirectOutputA());
            compilationManager.processResource(context, toProcess.toArray(new EfestoResource[0]));
            assertThat(context.getGeneratedResourcesMap()).hasSize(1);

            Map<String, IndexFile> indexFiles = context.createIndexFiles(TARGET_TEST_CLASSES_DIRECTORY);
            assertThat(indexFiles).hasSize(1);
            indexFile = indexFiles.get("mock");
            assertThat(indexFile).exists();
        } catch (Exception e) {
            fail("failed during 1st round", e);
        }

        // 2nd round
        try {
            EfestoCompilationContext context = EfestoCompilationContextUtils.buildWithParentClassLoader(CompilationManager.class.getClassLoader());
            List<AbstractMockOutput> toProcess = new ArrayList<>();
            toProcess.add(new MockEfestoRedirectOutputE());
            compilationManager.processResource(context, toProcess.toArray(new EfestoResource[0]));
            assertThat(context.getGeneratedResourcesMap()).hasSize(1);

            Map<String, IndexFile> indexFiles = context.createIndexFiles(TARGET_TEST_CLASSES_DIRECTORY);
            assertThat(indexFiles).hasSize(1);
            indexFile = indexFiles.get("mock");
            assertThat(indexFile).exists();

            GeneratedResources finalContent = getGeneratedResourcesObject(indexFile);
            assertThat(finalContent).hasSize(2);

            List<ModelLocalUriId> friList = Arrays.asList(new MockEfestoCallableOutput().getModelLocalUriId(), new MockEfestoCallableOutputE().getModelLocalUriId());

            List<GeneratedExecutableResource> resourceList = finalContent.stream().filter(GeneratedExecutableResource.class::isInstance)
                    .map(GeneratedExecutableResource.class::cast)
                    .filter(resource -> friList.contains(resource.getModelLocalUriId()))
                    .collect(Collectors.toList());

            // contains "/mock/mock/efesto/output/module" and "/mock/mock/efesto/output/moduleE"
            assertThat(resourceList).hasSize(2);
        } catch (Exception e) {
            fail("failed during 2nd round", e);
        } finally {
            if (indexFile != null) {
                indexFile.delete();
            }
        }
    }