private static PsiType @NotNull [] flattenAndRemoveDuplicates(PsiType @NotNull [] conjuncts) {
    try {
      final Set<PsiType> flattenConjuncts = flatten(conjuncts, new LinkedHashSet<>());
      return flattenConjuncts.toArray(createArray(flattenConjuncts.size()));
    }
    catch (NoSuchElementException e) {
      throw new RuntimeException(Arrays.toString(conjuncts), e);
    }
  }
private static PsiType @NotNull [] flattenAndRemoveDuplicates(PsiType @NotNull [] conjuncts)