final @NotNull List<T> buildExtensionsFromExtensionPoint(@NotNull Predicate<? super KeyedLazyInstance<T>> isMyBean,
                                                           @NotNull List<? extends KeyedLazyInstance<T>> extensions) {
    List<T> result = null;
    T r1 = null;
    T r2 = null;
    for (KeyedLazyInstance<T> bean : extensions) {
      if (!isMyBean.test(bean)) {
        continue;
      }

      T instance = instantiate(bean);
      if (instance == null) {
        continue;
      }

      if (result != null) {
        result.add(instance);
      }
      else if (r1 == null) {
        r1 = instance;
      }
      else if (r2 == null) {
        r2 = instance;
      }
      else {
        result = new ArrayList<>();
        result.add(r1);
        result.add(r2);
        result.add(instance);
      }
    }

    if (result != null) {
      return result;
    }
    else if (r2 != null) {
      return Java11Shim.INSTANCE.listOf(r1, r2);
    }
    else if (r1 != null) {
      return Java11Shim.INSTANCE.listOf(r1);
    }
    else {
      return Java11Shim.INSTANCE.listOf();
    }
  }
final @NotNull List<T> buildExtensionsFromExtensionPoint(@NotNull Predicate<? super KeyedLazyInstance<T>> isMyBean,
                                                           @NotNull List<? extends KeyedLazyInstance<T>> extensions)