def METHOD_NAME(self):
    a = get_mosaic("abc", 3, "mosaic")
    b = get_mosaic("abc", 4, "a")
    c = get_mosaic("zzz", 3, "mosaic")
    d = get_mosaic("abc", 8, "mosaic")
    e = get_mosaic("aaa", 1, "mosaic")
    f = get_mosaic("aaa", 1, "mosaicz")
    g = get_mosaic("zzz", 30, "mosaic")
    res = canonicalize_mosaics([a, b, c, d, e, f, g])
    self.assertEqual(res, [e, f, b, a, c])
    self.assertEqual(res[2].quantity, b.quantity)
    self.assertEqual(res[3].quantity, 3 + 8)  # a + d
    self.assertEqual(res[4].quantity, 3 + 30)  # c + g