@Test public void testGetNextMessageIdReturnsMid() { InMemoryMessageIdProvider provider = new InMemoryMessageIdProvider(config); InetSocketAddress peerAddress = getPeerAddress(1); int mid1 = provider.getNextMessageId(peerAddress); int mid2 = provider.getNextMessageId(peerAddress); assertThat(mid1, is(not(-1))); assertThat(mid2, is(not(-1))); assertThat(mid1, is(not(mid2))); }
@Override public int getNextMessageId(final InetSocketAddress destination) { MessageIdTracker tracker = getTracker(destination); if (tracker == null) { return Message.NONE; } else { return tracker.getNextMessageId(); } }
InMemoryMessageIdProvider implements MessageIdProvider { @Override public int getNextMessageId(final InetSocketAddress destination) { MessageIdTracker tracker = getTracker(destination); if (tracker == null) { return Message.NONE; } else { return tracker.getNextMessageId(); } } }
InMemoryMessageIdProvider implements MessageIdProvider { @Override public int getNextMessageId(final InetSocketAddress destination) { MessageIdTracker tracker = getTracker(destination); if (tracker == null) { return Message.NONE; } else { return tracker.getNextMessageId(); } } InMemoryMessageIdProvider(final NetworkConfig config); }
InMemoryMessageIdProvider implements MessageIdProvider { @Override public int getNextMessageId(final InetSocketAddress destination) { MessageIdTracker tracker = getTracker(destination); if (tracker == null) { return Message.NONE; } else { return tracker.getNextMessageId(); } } InMemoryMessageIdProvider(final NetworkConfig config); @Override int getNextMessageId(final InetSocketAddress destination); }
InMemoryMessageIdProvider implements MessageIdProvider { @Override public int getNextMessageId(final InetSocketAddress destination) { MessageIdTracker tracker = getTracker(destination); if (tracker == null) { return Message.NONE; } else { return tracker.getNextMessageId(); } } InMemoryMessageIdProvider(final NetworkConfig config); @Override int getNextMessageId(final InetSocketAddress destination);  }