public static PipelineIR compileSources(List<SourceWithMetadata> sourcesWithMetadata, boolean supportEscapes, ConfigVariableExpander cve) throws InvalidIRException {
        Map<PluginDefinition.Type, List<Graph>> groupedPipelineSections = sourcesWithMetadata.stream()
                .map(swm -> compileGraph(swm, supportEscapes, cve))
                .flatMap(m -> m.entrySet().stream())
                .filter(e -> e.getValue() != null)
                .collect(groupingBy(Map.Entry::getKey,
                            mapping(Map.Entry::getValue, toList())));

        Graph inputGraph = Graph.combine(groupedPipelineSections.get(PluginDefinition.Type.INPUT).toArray(new Graph[0])).graph;
        Graph outputGraph = Graph.combine(groupedPipelineSections.get(PluginDefinition.Type.OUTPUT).toArray(new Graph[0])).graph;
        Graph filterGraph = groupedPipelineSections.get(PluginDefinition.Type.FILTER).stream()
                .reduce(ConfigCompiler::chainWithUntypedException).orElse(null);

        String originalSource = sourcesWithMetadata.stream().map(SourceWithMetadata::getText).collect(Collectors.joining("\n"));
        return new PipelineIR(inputGraph, filterGraph, outputGraph, originalSource);
    }
@Test
    public void testCompileWithAnEmptySource() throws InvalidIRException {
        List<SourceWithMetadata> sourcesWithMetadata = Arrays.asList(
                new SourceWithMetadata("str", "in_plugin", 0, 0, "input { input_0 {} } "),
                new SourceWithMetadata("str", "out_plugin", 0, 0, "output { output_0 {} } "),
                new SourceWithMetadata("str", "<empty>", 0, 0, "     ")
        );

        PipelineIR pipeline = ConfigCompiler.compileSources(sourcesWithMetadata, false, null);

        assertEquals("should compile only the text parts", 2L, pipeline.pluginVertices().count());
    }