private static PsiElement addInlineArrayItem(@NotNull YAMLSequence array, @NotNull String itemValue) {
      YAMLElementGenerator generator = YAMLElementGenerator.getInstance(array.getProject());
      YAMLSequenceItem sequenceItem = generator.createArrayItem(itemValue);

      PsiElement addedItem = array.addBefore(sequenceItem, array.getLastChild()); // we insert before closing bracket ']'
      if (array.getItems().size() > 1) {
        array.addAfter(generator.createComma(), PsiTreeUtil.skipWhitespacesAndCommentsBackward(addedItem));
      }
      return addedItem;
    }
private static PsiElement addInlineArrayItem(@NotNull YAMLSequence array, @NotNull String itemValue)