private static <T extends PsiElement> PsiElement @NotNull [] collectElements(int endOffset, @NotNull T property, @NotNull Class<T> kind) {
    final List<T> properties = new SmartList<>(property);
    PsiElement nextSibling = property.getNextSibling();
    while (nextSibling != null && nextSibling.getTextRange().getEndOffset() <= endOffset) {
      if (kind.isInstance(nextSibling)) {
        properties.add(kind.cast(nextSibling));
      }
      nextSibling = nextSibling.getNextSibling();
    }
    return properties.toArray(PsiElement.EMPTY_ARRAY);
  }
private static <T extends PsiElement> PsiElement @NotNull [] collectElements(int endOffset, @NotNull T property, @NotNull Class<T> kind)