Helper to get Longs from ByteArrays and some Unit tests