public static void Switch(int id) { SeleniumWrapper pointedWrapper = wrappers.Where(x => x.Id == id).FirstOrDefault(); CurrentWrapper = pointedWrapper ?? throw new InvalidOperationException($"Selenium browser instance with id '{id}' does not exist"); CurrentWrapper.BringWindowToForeground(); }