@Test
    public void testGetBytesInRange() {
    	try {
    		ByteUtils.getBytesInRange(-1, 3);
    		fail("Expected illegal argument exception");
    	} catch (IllegalArgumentException expected) {};
    	
    	try {
    		ByteUtils.getBytesInRange(1, -3);
    		fail("Expected illegal argument exception");
    	} catch (IllegalArgumentException expected) {};
    	
    	try {
    		ByteUtils.getBytesInRange(1, 257);
    		fail("Expected illegal argument exception");
    	} catch (IllegalArgumentException expected) {};
    	
    	try {
    		ByteUtils.getBytesInRange(257, -1);
    		fail("Expected illegal argument exception");
    	} catch (IllegalArgumentException expected) {};

    	for (int i = 0; i < 256; i++) {
    		for (int j = 0; j< 256; j++) {
    			final int start = i < j? i : j;
    			final int end   = i < j? j : i;
    			final int length = end - start + 1;
    			final byte[] expected = new byte[length];
    			for (int k = 0; k < length; k++) {
    				expected[k] = (byte) (k + start);
    			}
    			byte[] result = ByteUtils.getBytesInRange(i,  j);
    			assertTrue("Byte range from " + i + " to " + j, Arrays.equals(expected, result));
    		}
    	}
    }