### Question:
FileByteBlock implements ByteBlock { public void setInt(BigInteger bigIndex, int value) throws ByteBlockAccessException { int index = bigIndex.intValue(); if (index < buf.length) { byte[] b = new byte[4]; converter.putInt(b, 0, value); System.arraycopy(b, 0, buf, index, b.length); } } FileByteBlock(byte[] b); String getLocationRepresentation(BigInteger bigIndex); int getMaxLocationRepresentationSize(); String getIndexName(); BigInteger getLength(); byte getByte(BigInteger bigIndex); int getInt(BigInteger bigIndex); long getLong(BigInteger bigIndex); void setByte(BigInteger bigIndex, byte value); void setInt(BigInteger bigIndex, int value); void setLong(BigInteger bigIndex, long value); boolean isEditable(); void setBigEndian(boolean bigEndian); boolean isBigEndian(); int getAlignment(int radix);  }### Answer:
@Test public void testSetInt() throws Exception { block.setBigEndian(true); DataConverter conv = BigEndianDataConverter.INSTANCE; byte[] b = new byte[4]; System.arraycopy(buf, 35, b, 0, b.length); conv.getInt(b); byte[] newb = new byte[4]; conv.putInt(newb, 0, 425); block.setInt(BigInteger.valueOf(35), 425); blockSet.notifyByteEditing(block, BigInteger.valueOf(35), b, newb); for (int i = 0; i < 4; i++) { assertTrue(blockSet.isChanged(block, BigInteger.valueOf(35 + i), b.length)); } block.setBigEndian(false); conv = LittleEndianDataConverter.INSTANCE; b = new byte[4]; System.arraycopy(buf, 35, b, 0, b.length); conv.getInt(b); newb = new byte[4]; conv.putInt(newb, 0, 425); block.setInt(BigInteger.valueOf(35), 425); blockSet.notifyByteEditing(block, BigInteger.valueOf(35), b, newb); for (int i = 0; i < 4; i++) { assertTrue(blockSet.isChanged(block, BigInteger.valueOf(35 + i), b.length)); } }
@Test public void testSetInt() throws Exception { block.setBigEndian(true); DataConverter conv = new BigEndianDataConverter(); byte[] b = new byte[4]; System.arraycopy(buf, 35, b, 0, b.length); conv.getInt(b); byte[] newb = new byte[4]; conv.putInt(newb, 0, 425); block.setInt(BigInteger.valueOf(35), 425); blockSet.notifyByteEditing(block, BigInteger.valueOf(35), b, newb); for (int i = 0; i < 4; i++) { assertTrue(blockSet.isChanged(block, BigInteger.valueOf(35 + i), b.length)); } block.setBigEndian(false); conv = new LittleEndianDataConverter(); b = new byte[4]; System.arraycopy(buf, 35, b, 0, b.length); conv.getInt(b); newb = new byte[4]; conv.putInt(newb, 0, 425); block.setInt(BigInteger.valueOf(35), 425); blockSet.notifyByteEditing(block, BigInteger.valueOf(35), b, newb); for (int i = 0; i < 4; i++) { assertTrue(blockSet.isChanged(block, BigInteger.valueOf(35 + i), b.length)); } }