private static PsiElement[] getElementsToSurround(SurroundDescriptor descriptor, PsiFile file, int[] startOffsets, int[] endOffsets) {
    final List<PsiElement> elementList = new ArrayList<>();
    for (int i = 0; i < startOffsets.length; ++i) {
      elementList.addAll(List.of(descriptor.getElementsToSurround(file, startOffsets[i], endOffsets[i])));
    }
    return elementList.toArray(PsiElement[]::new);
  }
private static PsiElement[] getElementsToSurround(SurroundDescriptor descriptor, PsiFile file, int[] startOffsets, int[] endOffsets)