### Question:
DefaultInMemoryMessageQueuePoller implements InMemoryMessageQueuePoller { @Override public void poll() { if (!polling && !transactionalResourceManager.inTransaction()) { polling = true; pollForAllMessages(); polling = false; } }  @Override void setTransactionalResourceManager(final TransactionalResourceManager transactionalResourceManager); @Override void register(final InMemoryMessageListener<?> inMemoryMessageListener); @Override void poll(); @Override String toString();  }### Answer:
@Test public void shouldReturnIfNoListenersRegistered_onPoll() { when(mockTransactionalResourceManager.inTransaction()).thenReturn(false); poller.poll(); }