Extract logic of positiveMatch and negativeMatch from ScalarMatcher

This PR extracts logic inside of `positiveMatch` and `negativeMatch` methods to
external two.
To remove duplication.