MessageUtils { public static boolean canRetry(Message message) { return message.getTtl() > 1; }  static Optional<Message> retry(Message message); static boolean canRetry(Message message); static Message message(CloudType cloudType, Serializable payload, int ttl); static Message message(CloudType cloudType, Serializable payload); static Message message(Serializable payload); static String getRealQueueName(String queueName, CloudType cloudType);  }
@Test public void testCanRetry() { String payload = "payload"; assertThat(canRetry(message(MOCK, payload, 2)), equalTo(true)); assertThat(canRetry(message(MOCK, payload, 1)), equalTo(false)); }