offset4 extends uint64_t { public void checkOverflow(length4 length, String msg) throws InvalException { checkOverflow(length.value, msg); } offset4();  offset4(long value);  offset4(XdrDecodingStream xdr); void checkOverflow(length4 length, String msg); void checkOverflow(int length, String msg); void checkOverflow(long length, String msg);  }
@Test public void shouldSucceedIfSumNotOverflow() throws Exception { offset4 offset = new offset4(5); length4 length = new length4(Long.MAX_VALUE - 10); offset.checkOverflow(length, null); }
@Test(expected = InvalException.class) public void shouldfailIfSumOverflow() throws Exception { offset4 offset = new offset4(UnsignedLong.MAX_VALUE.longValue()); length4 length = new length4(5); offset.checkOverflow(length, null); }
@Test public void shouldSuccessSignedLongOverflow() throws Exception { offset4 offset = new offset4(Long.MAX_VALUE); length4 length = new length4(5); offset.checkOverflow(length, null); }