implement Encoder test