union_find: use better asserts in test
optimizer_tests: remove unused import