### Question:
BeaconParser implements Serializable { public static byte[] longToByteArray(long longValue, int length) { return longToByteArray(longValue, length, true); } BeaconParser();  BeaconParser(String identifier); BeaconParser setBeaconLayout(String beaconLayout); boolean addExtraDataParser(BeaconParser extraDataParser); List<BeaconParser> getExtraDataParsers(); String getIdentifier(); int[] getHardwareAssistManufacturers(); void setHardwareAssistManufacturerCodes(int[] manufacturers); void setAllowPduOverflow(Boolean enabled); Long getMatchingBeaconTypeCode(); int getMatchingBeaconTypeCodeStartOffset(); int getMatchingBeaconTypeCodeEndOffset(); Long getServiceUuid(); int getMServiceUuidStartOffset(); int getServiceUuidEndOffset(); Beacon fromScanData(byte[] scanData, int rssi, BluetoothDevice device, long timestampMs); @TargetApi(Build.VERSION_CODES.GINGERBREAD) byte[] getBeaconAdvertisementData(Beacon beacon); BeaconParser setMatchingBeaconTypeCode(Long typeCode); int getIdentifierByteCount(int identifierNum); int getIdentifierCount(); int getDataFieldCount(); String getLayout(); int getPowerCorrection(); static byte[] longToByteArray(long longValue, int length); static byte[] longToByteArray(long longValue, int length, boolean bigEndian); @Override int hashCode(); @Override boolean equals(Object o); static final String ALTBEACON_LAYOUT; static final String EDDYSTONE_TLM_LAYOUT; static final String EDDYSTONE_UID_LAYOUT; static final String EDDYSTONE_URL_LAYOUT; static final String URI_BEACON_LAYOUT; }### Answer:
@Test public void testLongToByteArray() { BeaconParser parser = new BeaconParser(); byte[] bytes = parser.longToByteArray(10, 1); assertEquals("first byte should be 10", 10, bytes[0]); }