Add test data generator for TrinaryPattern and tests