public void testAddMigrationListener_whenListenerRegisteredTwice() {
TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
HazelcastInstance hz1 = factory.newHazelcastInstance();
PartitionService partitionService = hz1.getPartitionService();
MigrationListener listener = mock(MigrationListener.class);
String id1 = partitionService.addMigrationListener(listener);
String id2 = partitionService.addMigrationListener(listener);
// first we check if the registration id's are different