### Question:
FileByteBlock implements ByteBlock { public void setByte(BigInteger bigIndex, byte value) throws ByteBlockAccessException { int index = bigIndex.intValue(); if (index < buf.length) { buf[index] = value; } } 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 testSetByte() throws Exception { block.setByte(BigInteger.ZERO, (byte) 33); assertEquals((byte) 33, block.getByte(BigInteger.ZERO)); blockSet.notifyByteEditing(block, BigInteger.ZERO, new byte[] { (byte) 0 }, new byte[] { (byte) 33 }); assertTrue(blockSet.isChanged(block, BigInteger.ZERO, 1)); block.setByte(BigInteger.valueOf(99), (byte) 33); assertEquals((byte) 33, block.getByte(BigInteger.valueOf(99))); blockSet.notifyByteEditing(block, BigInteger.valueOf(99), new byte[] { (byte) 99 }, new byte[] { (byte) 33 }); assertTrue(blockSet.isChanged(block, BigInteger.valueOf(99), 1)); }
@Test public void testSave() throws Exception { for (int i = 0; i < 20; i++) { block.setByte(BigInteger.valueOf(i), (byte) (10 + i)); } File f = createTempFile("updated", ".bin"); blockSet.save(f.getAbsolutePath()); assertTrue(f.exists()); assertEquals(100, f.length()); FileInputStream fis = new FileInputStream(f); byte[] b = new byte[100]; fis.read(b); fis.close(); f.delete(); for (int i = 0; i < 20; i++) { assertEquals((byte) (10 + i), b[i]); assertTrue(!blockSet.isChanged(block, BigInteger.valueOf(i), 1)); } }