Unittest for distinct