Maybe this should be rootTests = new UnitTest[0]; because public methods RefreshTests and SearchTest are not doing null checking... Or null checking could be added to methods or this is impossible to happen?