### Question:
LogIndexTxHeaderEncoding { public static long decodeLogIndexFromTxHeader( byte[] bytes ) { if ( bytes.length < Long.BYTES ) { throw new IllegalArgumentException( "Unable to decode RAFT log index from transaction header" ); } long logIndex = 0; for ( int i = 0; i < Long.BYTES; i++ ) { logIndex <<= Byte.SIZE; logIndex ^= bytes[i] & 0xFF; } return logIndex; } private  LogIndexTxHeaderEncoding(); static byte[] encodeLogIndexAsTxHeader( long logIndex ); static long decodeLogIndexFromTxHeader( byte[] bytes );  }### Answer:
@Test public void shouldThrowExceptionForAnEmptyByteArray() { try { decodeLogIndexFromTxHeader( new byte[0] ); fail( "Should have thrown an exception because there's no way to decode this " ); } catch ( IllegalArgumentException e ) { assertEquals( "Unable to decode RAFT log index from transaction header", e.getMessage() ); } }