Implemented compare(), compare_i() interfaces and wrote their tests.