Add getMatchingPatterns method to Patterns condition

Issue: SPR-11484