Implementation of match criteria.
Tests for match criteria.