Change test from equals to compareTo