I found that some codes can be refactoring with stream,so I submit a PR.

Comment From: pivotal-issuemaster

@saveunhappy Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

Comment From: pivotal-issuemaster

@saveunhappy Thank you for signing the Contributor License Agreement!

Comment From: snicoll

I think the code is fine as it is now. We prefer to use explicit loops in simple cases like these as it improves readability. Thanks for the PR, in any case.