Refactor test of matcher into common abstract test