use of org.bboxdb.commons.ServiceState.State in project bboxdb by jnidzwetzki.
the class TestServiceState method testCallbackListenerRegisterAndUnregister.
/**
* Test the register and unregister method
*/
@Test(timeout = 60000)
public void testCallbackListenerRegisterAndUnregister() {
final ServiceState state = new ServiceState();
final Consumer<? super ServiceState> consumer = (s) -> {
};
// Callback is unkown
Assert.assertFalse(state.removeCallback(consumer));
state.registerCallback(consumer);
// Callback is known
Assert.assertTrue(state.removeCallback(consumer));
// Callback is unkown
Assert.assertFalse(state.removeCallback(consumer));
}