Message { public void setPriority(int priority) { if (priority < 0 || priority > 99) { throw new IllegalArgumentException("priority MUST be between 0 and 99 (inclusive)"); } this.priority = priority; } Message();  Message(String id, String payload); String getId(); void setId(String id); String getPayload(); void setPayload(String payload); void setTimeout(long timeout); void setTimeout(long time, TimeUnit unit); long getTimeout(); void setPriority(int priority); int getPriority(); String getShard(); void setShard(String shard); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test(expected = IllegalArgumentException.class) public void testPrioirty() { Message msg = new Message(); msg.setPriority(-1); }
@Test(expected = IllegalArgumentException.class) public void testPrioirty2() { Message msg = new Message(); msg.setPriority(100); }