AnAction (@NotNull Consumer<? super Integer> onSelected, int defaultSelection) { List<? extends DiffRequestProducer> requests = getRequests(); // may contain other producers with intermediate MessageDiffRequest List<Producer> producers = ContainerUtil.map(requests, it -> ObjectUtils.tryCast(it, Producer.class)); if (!ContainerUtil.all(producers, Conditions.notNull())) return null; return ChangeDiffRequestChain.createGoToChangeAction(producers, onSelected, defaultSelection); }