[PATCH 4/6] amstream/tests: Move the testfilter code above to use it in SetState tests.