SendOptions { public static SendOptionsBuilder builder() { return new SendOptionsBuilder(); } private  SendOptions(QOS qos, long ttl, boolean retainLink); final QOS getQos(); final long getTtl(); final boolean getRetainLink(); @Override String toString(); static SendOptionsBuilder builder();  }
@Test public void qosValues() { SendOptions.builder().setQos(QOS.AT_LEAST_ONCE); SendOptions.builder().setQos(QOS.AT_MOST_ONCE); try { SendOptions.builder().setQos(null); throw new AssertionFailedError("null should have been rejected"); } catch(IllegalArgumentException e) { } }
@Test public void ttlValues() { SendOptions.builder().setTtl(1); SendOptions.builder().setTtl(4294967295L); try { SendOptions.builder().setTtl(0); throw new AssertionFailedError("0 should have been rejected"); } catch(IllegalArgumentException e) { } try { SendOptions.builder().setTtl(4294967296L); throw new AssertionFailedError("4294967296L should have been rejected"); } catch(IllegalArgumentException e) { } }