There is 2-bytes array: private byte[] mData;
and method:
public void setWord(final short pData) {
        mData[0] = (byte) (pData >>> 8);
        mData[1] = (byte) (pData);
}
I wrote the simple test:
public void testWord() {
        Word word = new Word();
        word.setWord((short) 0x3FFF);
        Assert.assertEquals(0x3F, word.getByte(0));
        Assert.assertEquals(0xFF, word.getByte(1));
}
The second assert fails with message "Expected 255, but was -1". I know, that 0xFF signed short is, in fact, -1, but why JUnit thinks, that they are not equal? And, what is the correct way to implement such classes?
 
     
     
    