### Question:
InstanceRepository { public void register(final Set<Instance> instances) { if (CollectionUtils.isEmpty(instances)) { return; } _client.unregister(instances); updateInstances(instances, RegisterType.register); } InstanceRepository(final ArtemisClientConfig config); Set<Instance> getAvailableInstances(); TextMessage getHeartbeatMessage(); void registerToRemote(final Set<Instance> instances); void register(final Set<Instance> instances); void unregister(final Set<Instance> instances);  }### Answer:
@Test public void testRegister() { final Set<Instance> instances = Instances.newInstances(2); repository.register(instances); Assert.assertTrue(_instances.get().containsAll(instances)); }
@Test public void registerToServicesRegistry() throws InterruptedException { final Set<Instance> instances = Instances.newInstances(2); repository.register(instances); Assert.assertTrue(_instances.get().containsAll(instances)); }