Fixed compile test error.
Changed Triplet sorting and compare. Now it behaves according to java specification.