### Question:
ByteUtils { public static long getLong(byte[] buffer, int offset) { return ((long) buffer[offset] << 56) | ((long) buffer[offset + 1] & 0xff) << 48 | ((long) buffer[offset + 2] & 0xff) << 40 | ((long) buffer[offset + 3] & 0xff) << 32 | ((long) buffer[offset + 4] & 0xff) << 24 | ((long) buffer[offset + 5] & 0xff) << 16 | ((long) buffer[offset + 6] & 0xff) << 8 | ((long) buffer[offset + 7] & 0xff); }  static void putLong(byte[] buffer, int offset, long l); static long getLong(byte[] buffer, int offset);  }### Answer:
@Test public void getLong() { byte[] array = new byte[8]; ByteBuffer buffer = ByteBuffer.wrap(array); buffer.putLong(42); assertThat(ByteUtils.getLong(array, 0)).isEqualTo(42); }