public void Stack_Generic_RemoveWhere(int count) { PooledStack <T> stack = GenericStackFactory(count); var startingCount = stack.Count; var expected = stack.Where(x => !RemoveWherePredicate(x)).ToPooledList(); stack.RemoveWhere(RemoveWherePredicate); Assert.Equal(expected.Count, stack.Count); Assert.Equal(expected, stack); expected.Dispose(); }