### Question:
FileByteBlock implements ByteBlock { public long getLong(BigInteger bigIndex) throws ByteBlockAccessException { int index = bigIndex.intValue(); if (index < buf.length) { byte[] b = new byte[8]; System.arraycopy(buf, index, b, 0, b.length); return converter.getLong(b); } return 0; } 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 testGetLong() throws Exception { block.setBigEndian(true); DataConverter conv = BigEndianDataConverter.INSTANCE; for (int i = 0; i < 10; i++) { byte[] b = new byte[8]; System.arraycopy(buf, i + 8, b, 0, b.length); assertEquals(conv.getLong(b), block.getLong(BigInteger.valueOf(i + 8))); } for (int i = 0; i < 10; i++) { byte[] b = new byte[8]; System.arraycopy(buf, i + 12, b, 0, b.length); assertEquals(conv.getLong(b), block.getLong(BigInteger.valueOf(i + 12))); } block.setBigEndian(false); conv = LittleEndianDataConverter.INSTANCE; for (int i = 0; i < 10; i++) { byte[] b = new byte[8]; System.arraycopy(buf, i + 8, b, 0, b.length); assertEquals(conv.getLong(b), block.getLong(BigInteger.valueOf(i + 8))); } for (int i = 0; i < 10; i++) { byte[] b = new byte[8]; System.arraycopy(buf, i + 12, b, 0, b.length); assertEquals(conv.getLong(b), block.getLong(BigInteger.valueOf(i + 12))); } }
@Test public void testGetLong() throws Exception { block.setBigEndian(true); DataConverter conv = new BigEndianDataConverter(); for (int i = 0; i < 10; i++) { byte[] b = new byte[8]; System.arraycopy(buf, i + 8, b, 0, b.length); assertEquals(conv.getLong(b), block.getLong(BigInteger.valueOf(i + 8))); } for (int i = 0; i < 10; i++) { byte[] b = new byte[8]; System.arraycopy(buf, i + 12, b, 0, b.length); assertEquals(conv.getLong(b), block.getLong(BigInteger.valueOf(i + 12))); } block.setBigEndian(false); conv = new LittleEndianDataConverter(); for (int i = 0; i < 10; i++) { byte[] b = new byte[8]; System.arraycopy(buf, i + 8, b, 0, b.length); assertEquals(conv.getLong(b), block.getLong(BigInteger.valueOf(i + 8))); } for (int i = 0; i < 10; i++) { byte[] b = new byte[8]; System.arraycopy(buf, i + 12, b, 0, b.length); assertEquals(conv.getLong(b), block.getLong(BigInteger.valueOf(i + 12))); } }