### Question:
BinaryReader { public long readNextUnsignedInt() throws IOException { return readNextInt() & NumberUtil.UNSIGNED_INT_MASK; } BinaryReader(ByteProvider provider, boolean isLittleEndian); BinaryReader clone(int newIndex); boolean isLittleEndian(); void setLittleEndian(boolean isLittleEndian); long length(); boolean isValidIndex(int index); boolean isValidIndex(long index); int align(int alignValue); void setPointerIndex(int index); void setPointerIndex(long index); long getPointerIndex(); byte peekNextByte(); short peekNextShort(); int peekNextInt(); long peekNextLong(); byte readNextByte(); int readNextUnsignedByte(); short readNextShort(); int readNextUnsignedShort(); int readNextInt(); long readNextUnsignedInt(); long readNextLong(); String readNextAsciiString(); String readNextNullTerminatedAsciiString(); String readNextAsciiString(int length); String readNextUnicodeString(); String readNextUnicodeString(int length); byte[] readNextByteArray(int nElements); short[] readNextShortArray(int nElements); int[] readNextIntArray(int nElements); long[] readNextLongArray(int nElements); String readAsciiString(long index); String readAsciiString(long index, int length); String readTerminatedString(long index, char termChar); String readTerminatedString(long index, String termChars); String readFixedLenAsciiString(long index, int len); String readUnicodeString(long index); String readUnicodeString(long index, int length); byte readByte(long index); int readUnsignedByte(long index); short readShort(long index); int readUnsignedShort(long index); int readInt(long index); long readUnsignedInt(long index); int readInt(long index, int minClamp, int maxClamp); long readLong(long index); long readValue(long index, int len); long readUnsignedValue(long index, int len); byte[] readByteArray(long index, int nElements); short[] readShortArray(long index, int nElements); int[] readIntArray(long index, int nElements); long[] readLongArray(long index, int nElements); String[] readAsciiStringArray(long index, int nElements); ByteProvider getByteProvider(); final static int SIZEOF_BYTE; final static int SIZEOF_SHORT; final static int SIZEOF_INT; final static int SIZEOF_LONG; }### Answer:
@Test public void testReadNextUnsignedInt() throws IOException { BinaryReader br = br(true, 1, 0, 0, 0, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0x80); assertEquals(1, br.readNextUnsignedInt()); assertEquals(Integer.MAX_VALUE, br.readNextUnsignedInt()); assertEquals(NumberUtil.UNSIGNED_INT_MASK , br.readNextUnsignedInt()); assertEquals((long) Integer.MAX_VALUE + 1 , br.readNextUnsignedInt()); try { br.readNextUnsignedInt(); fail("Should have triggered IOException"); } catch (IOException ioe) { } }