vtkIdList::Resize() does not update NumberOfIds
See the code https://gitlab.kitware.com/vtk/vtk/blob/master/Common/Core/vtkIdList.cxx#L141
Sample code
vtkNew<vtkIdList> id;
id->SetNumberOfIds(10);
id->SetId(0, 1);
id->SetId(1, 2);
id->Resize(1);
// id->GetNumberOfIds() returns 10 and a subsequent id->GetId(1) may result in segmentation fault.