MessageSequenceNumber { public static MessageSequenceNumber of(int msn) { Preconditions.checkArgument(msn >= 0); return new MessageSequenceNumber(msn); } private  MessageSequenceNumber(int msn); static MessageSequenceNumber of(int msn); int asInt(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test void ofShouldThrowOnNegative() { assertThatThrownBy(() -> MessageSequenceNumber.of(-1)).isInstanceOf(IllegalArgumentException.class); }
@Test void ofShouldNotThrowOnZero() { assertThatCode(() -> MessageSequenceNumber.of(0)).doesNotThrowAnyException(); }
@Test void ofShouldNotThrowOnPositiveValue() { assertThatCode(() -> MessageSequenceNumber.of(12)).doesNotThrowAnyException(); }