private static @NotNull CompositeElement createComposite(@NotNull StartMarker marker, @Nullable ASTFactory astFactory) {
    IElementType type = marker.myType;
    if (type == TokenType.ERROR_ELEMENT) {
      String error = marker.myBuilder.myOptionalData.getDoneError(marker.markerId);
      Objects.requireNonNull(error);
      return Factory.createErrorElement(error);
    }

    if (type == null) {
      throw new RuntimeException(UNBALANCED_MESSAGE);
    }

    if (astFactory != null) {
      CompositeElement composite = astFactory.createComposite(marker.getTokenType());
      if (composite != null) return composite;
    }
    return ASTFactory.composite(type);
  }
private static @NotNull CompositeElement createComposite(@NotNull StartMarker marker, @Nullable ASTFactory astFactory)