MessageDispatcher { public int getEstimatedCapacity(Instant cutoff) { if (!stats.hasSamples()) { log.info("No message processing stats yet. Returning estimated capacity of INT_MAX"); return Integer.MAX_VALUE; } return stats.getEstimatedCapacity(Duration.between(Instant.now(clock), cutoff)); } MessageDispatcher(final SQSProxy sqsProxy, final MessageProcessorProxy messageProcessorProxy); void dispatch(final List<Message> messages); void reset(); int getEstimatedCapacity(Instant cutoff);  }
@Test public void getEstimatedCapacity_noMessagesProcessed() throws Exception { assertThat(dispatcher.getEstimatedCapacity(NOW), is(Integer.MAX_VALUE)); }