### Question:
QueueSelector { public static int select(String tokenId, int queues) { Reject.ifTrue(tokenId == null, "Token ID cannot be null"); Reject.ifTrue(queues <= 0, "queues must be positive"); int value = Math.abs(tokenId.hashCode()); return value % queues; } private  QueueSelector(); static int select(String tokenId, int queues);  }### Answer:
@Test public void shouldBeConsistentWithTokens() { assertThat(QueueSelector.select(tokenId, 2)).isEqualTo(QueueSelector.select(tokenId, 2)); }
@Test (expectedExceptions = IllegalArgumentException.class) public void shouldEnforceQueuesAsPositive() { QueueSelector.select(tokenId, 0); }
@Test (expectedExceptions = IllegalArgumentException.class) public void shouldNotSupportNullToken() { QueueSelector.select(null, 2); }
@Test public void shouldNotReturnNegativeNumber() { for (int ii = 0; ii < 1000; ii++) { int select = QueueSelector.select(Integer.toString(ii), 32); assertThat(select).isGreaterThanOrEqualTo(0); } }