public static TextAttributesKey @NotNull [] pack(TextAttributesKey @NotNull [] base, @Nullable TextAttributesKey key) {
    if (key == null) return base;
    TextAttributesKey[] result = Arrays.copyOf(base, base.length + 1);
    result[base.length] = key;
    return result;
  }
public static TextAttributesKey @NotNull [] pack(TextAttributesKey @NotNull [] base, @Nullable TextAttributesKey key)