@Test public void testMessageGroupIdShouldBeBetween0AndCacheSize() { for (int i = 0; i < 10000; i++) { final String uuid = UUID.randomUUID().toString(); final String messageGroupId = this.messageSender.getMessageGroupId(uuid); final int actual = Integer.valueOf(messageGroupId); assertThat(actual >= 0 && actual < this.messageGroupCacheSize) .as("Message group id should be between 0 and cache size " + this.messageGroupCacheSize).isTrue(); } }
protected String getMessageGroupId(final String deviceIdentification) { return String.valueOf(Math.abs(deviceIdentification.hashCode() % this.messageGroupCacheSize)); }
ProtocolRequestMessageSender implements ProtocolRequestService { protected String getMessageGroupId(final String deviceIdentification) { return String.valueOf(Math.abs(deviceIdentification.hashCode() % this.messageGroupCacheSize)); } }
ProtocolRequestMessageSender implements ProtocolRequestService { protected String getMessageGroupId(final String deviceIdentification) { return String.valueOf(Math.abs(deviceIdentification.hashCode() % this.messageGroupCacheSize)); }  }
ProtocolRequestMessageSender implements ProtocolRequestService { protected String getMessageGroupId(final String deviceIdentification) { return String.valueOf(Math.abs(deviceIdentification.hashCode() % this.messageGroupCacheSize)); }  @Override boolean isSupported(final ProtocolInfo protocolInfo); @Override void send(final ProtocolRequestMessage message, final ProtocolInfo protocolInfo); }
ProtocolRequestMessageSender implements ProtocolRequestService { protected String getMessageGroupId(final String deviceIdentification) { return String.valueOf(Math.abs(deviceIdentification.hashCode() % this.messageGroupCacheSize)); }  @Override boolean isSupported(final ProtocolInfo protocolInfo); @Override void send(final ProtocolRequestMessage message, final ProtocolInfo protocolInfo);  }