@Override
  public void start() {
    Context context = new Context();
    definitions.forEach(definition -> definition.define(context));
    Context coreContext = new Context();
    corePageDefinitions.stream()
      .map(CorePageDefinition::getPageDefinition)
      .forEach(definition -> definition.define(coreContext));
    context.getPages().forEach(this::checkPluginExists);
    coreContext.getPages().forEach(this::checkCoreExtensionExists);
    pages = new ArrayList<>();
    pages.addAll(context.getPages());
    pages.addAll(coreContext.getPages());
    pages.sort(comparing(Page::getKey));
  }
@Test
  public void fail_if_page_with_unknown_plugin() {
    PageDefinition governance = context -> context.addPage(Page.builder("governance/my_key").setName("N1").build());
    PageDefinition plugin42 = context -> context.addPage(Page.builder("plugin_42/my_key").setName("N2").build());
    pluginRepository = mock(PluginRepository.class);
    when(pluginRepository.hasPlugin("governance")).thenReturn(true);
    underTest = new PageRepository(pluginRepository, coreExtensionRepository, new PageDefinition[]{governance, plugin42});

    assertThatThrownBy(() -> underTest.start())
      .isInstanceOf(IllegalStateException.class)
      .hasMessageContaining("Page 'N2' references plugin 'plugin_42' that does not exist");
  }