### Question:
BluetoothBytesParser { public long getLongValue() { return getLongValue(byteOrder); } BluetoothBytesParser();  BluetoothBytesParser(ByteOrder byteOrder);  BluetoothBytesParser(byte[] value);  BluetoothBytesParser(byte[] value, ByteOrder byteOrder);  BluetoothBytesParser(byte[] value, int offset);  BluetoothBytesParser(byte[] value, int offset, ByteOrder byteOrder); Integer getIntValue(int formatType); Integer getIntValue(int formatType, ByteOrder byteOrder); long getLongValue(); long getLongValue(ByteOrder byteOrder); long getLongValue(int offset, ByteOrder byteOrder); Integer getIntValue(int formatType, int offset, ByteOrder byteOrder); Float getFloatValue(int formatType); Float getFloatValue(int formatType, ByteOrder byteOrder); Float getFloatValue(int formatType, int offset, ByteOrder byteOrder); String getStringValue(); String getStringValue(int offset); Date getDateTime(); Date getDateTime(int offset); byte[] getValue(); boolean setIntValue(int value, int formatType, int offset); boolean setIntValue(int value, int formatType); boolean setLong(long value); boolean setLong(long value, int offset); boolean setFloatValue(int mantissa, int exponent, int formatType, int offset); boolean setFloatValue(float value, int precision); boolean setString(String value); boolean setString(String value, int offset); void setValue(byte[] value); boolean setCurrentTime(Calendar calendar); boolean setDateTime(Calendar calendar); static String bytes2String(final byte[] bytes); static byte[] mergeArrays(byte[]... arrays); int getOffset(); void setOffset(int offset); ByteOrder getByteOrder(); @Override String toString(); static final int FORMAT_UINT8; static final int FORMAT_UINT16; static final int FORMAT_UINT32; static final int FORMAT_SINT8; static final int FORMAT_SINT16; static final int FORMAT_SINT32; static final int FORMAT_SFLOAT; static final int FORMAT_FLOAT; }### Answer:
@Test public void parseLong_BigEndianTest() { BluetoothBytesParser parser; parser = new BluetoothBytesParser(new byte[]{0,0,0,0,0,0,0,1}, BIG_ENDIAN); assertEquals(1L, parser.getLongValue()); parser = new BluetoothBytesParser(new byte[]{0,0,0,0,0,0,1,1}, BIG_ENDIAN); assertEquals(257L, parser.getLongValue()); parser = new BluetoothBytesParser(new byte[]{1,1,1,1,1,1,1,1}, BIG_ENDIAN); assertEquals(72340172838076673L, parser.getLongValue()); parser = new BluetoothBytesParser(new byte[]{1,2,3,4,5,6,7,8}, BIG_ENDIAN); assertEquals(72623859790382856L, parser.getLongValue()); }
@Test public void parseLong_LittleEndianTest() { BluetoothBytesParser parser; parser = new BluetoothBytesParser(new byte[]{1,0,0,0,0,0,0,0}, LITTLE_ENDIAN); assertEquals(1L, parser.getLongValue()); parser = new BluetoothBytesParser(new byte[]{1,1,0,0,0,0,0,0}, LITTLE_ENDIAN); assertEquals(257L, parser.getLongValue()); parser = new BluetoothBytesParser(new byte[]{1,1,1,1,1,1,1,1}, LITTLE_ENDIAN); assertEquals(72340172838076673L, parser.getLongValue()); parser = new BluetoothBytesParser(new byte[]{8,7,6,5,4,3,2,1}, LITTLE_ENDIAN); assertEquals(72623859790382856L, parser.getLongValue()); }