Created test method, encoding and decoding methods.