public void testWithCustomNewMessageIdentifier() throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
StatefulRetryOperationsInterceptor interceptor =
RetryInterceptorBuilder.stateful()
.maxAttempts(5)
.newMessageIdentifier(new NewMessageIdentifier() {
@Override
public boolean isNew(Message message) {
latch.countDown();
return false;