Update for windows.
Simplify the test by lambda.