@Test
public void registerActorAndDisposableThroughRegisterWithConsumer() throws Exception {

    ActorSystemInstance actorSystem = ActorSystemInstance
            .getInstance("registerActorAndDisposableThroughRegisterWithConsumer");
    final TestActor actor = new TestActor();
    actorSystem.register(TestActor.class, Schedulers.trampoline(), new Consumer<Message>() {
        @Override
        public void accept(@NonNull Message message) throws Exception {
            actor.onMessageReceived(message);
        }
    });
    assertTrue(actorSystem.getMailboxes().containsKey(TestActor.class).blockingGet()
            && !actorSystem.getActorsDisposables().get(TestActor.class).blockingFirst().isDisposed());
}