Anton Baskanov : amstream/tests: Move the testfilter code above to use it in SetState tests.