I extended the test with duplicated hex variants to better visualize the 
public void checkUnsignedBoundsLongHex() {
    // Hex representation to visualize valid bounds in bytes
    ByteValue.checkUnsignedBounds(0x0_00_00, 2);
    ByteValue.checkUnsignedBounds(0x0_FF_FF, 2);
@Test(expected = IllegalArgumentException.class)
public void checkUnsignedBoundsLongTooBigHex() {
    ByteValue.checkUnsignedBounds(0x1_FF_FF, 2);
And the same for BigInteger.


> Am 22.02.2018 um 11:39 schrieb Justin Mclean <justinmcl...@me.com>:
> Hi,
>> Ok ... if the max value is outside the bounds and the code should have 
>> thrown an error, then I apologize.
> No issue. Looking again at it I’m still not sure which bit or code or test is 
> wrong or perhaps neither(?) but I think it should be consistent. Perhaps 
> Sebastian has a better idea?
>> But if you find something like this, wouldn't it be better to fix the broken 
>> code or at least leave a comment in the test that is guaranteed to break?
> I wasn't 100% sure which method had the incorrect boundary condition.
> Thanks,
> Justin

Reply via email to