class NewContainerWizard extends AbstractMultiPageWizard {

    @Override
    public void pageSelected(final int pageNumber) {
        if (this.getSelectedPage() == pageNumber) {
            return;
        }

        if (pageNumber == 1 && !isSelected) {
            GAV gav = newContainerFormPresenter.getCurrentGAV();
            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))
                        .sorted(Comparator.comparing(JarListPageRow::getLastModified).reversed()).findFirst();
                if (optionalJarListPageRow.isPresent()) {
                    if (optionalJarListPageRow.get().getPath() != null && !optionalJarListPageRow.get().getPath().isEmpty()) {
                        dependencyPathSelectedEvent.fire(new DependencyPathSelectedEvent(this, optionalJarListPageRow.get().getPath()));
                    }
                } else {
                    notification.fire(new NotificationEvent(newContainerFormPresenter.getView().getNewContainerGAVNotExist(gav.toString()), NotificationEvent.NotificationType.ERROR));
                }
            }).listArtifacts(request);
        }
        super.pageSelected(pageNumber);
    }

    @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);

}