class NewContainerWizard extends AbstractMultiPageWizard {

    @Override
    public void complete() {
        final Map<Capability, ContainerConfig> mapConfig = new HashMap<Capability, ContainerConfig>();
        if (getPages().size() == 2) {
            mapConfig.put(Capability.PROCESS, processConfigPagePresenter.buildProcessConfig());
        }
        mapConfig.put(Capability.RULE, new RuleConfig(null, KieScannerStatus.STOPPED));
        final ContainerSpec newContainer = newContainerFormPresenter.buildContainerSpec(newContainerFormPresenter.getServerTemplate().getId(),
                                                                                        mapConfig);
        GAV gav = new GAV(newContainer.getReleasedId().getGroupId(), newContainer.getReleasedId().getArtifactId(), newContainer.getReleasedId().getVersion());
        JarListPageRequest request = new JarListPageRequest(0, Integer.MAX_VALUE, null, Arrays.asList("jar"), null, false);

        m2RepoService.call(response -> {
            List<JarListPageRow> jarListPageRowList = ((PageResponse<JarListPageRow>) response).getPageRowList();
            Optional<JarListPageRow> optionalJarListPageRow = jarListPageRowList.stream().filter(jarListPageRow -> jarListPageRow.getGav().equals(gav)).findFirst();
            if (optionalJarListPageRow.isPresent()) {
                saveContainerSpec(newContainer);
            } else {
                confirmPopup.show(newContainerFormPresenter.getView().getNewContainerSaveContainerSpec(), newContainerFormPresenter.getView().getNewContainerSave(),
                                  newContainerFormPresenter.getView().getNewContainerGAVNotExistSave(gav.toString()), () -> saveContainerSpec(newContainer));
            }
        }).listArtifacts(request);
    }

    @Inject public  NewContainerWizard(final NewContainerFormPresenter newContainerFormPresenter,
                              final ProcessConfigPagePresenter processConfigPagePresenter,
                              final Caller<SpecManagementService> specManagementService,
                              final Event<NotificationEvent> notification,
                              final Event<ServerTemplateSelected> serverTemplateSelectedEvent,
                              final Event<DependencyPathSelectedEvent> dependencyPathSelectedEvent,
                              final Caller<M2RepoService> m2RepoService,
                              final ConfirmPopup confirmPopup);

}