Buggy code:
public class OWALChangesTree { private static final boolean BLACK = false ; private static final boolean RED = true ; private OWALChangesTree . Node root = null ; private int version = 0 ; private boolean debug ; private int serializedSize = OIntegerSerializer . INT_SIZE ; public void setDebug ( boolean debug ) { } public byte getByteValue ( ODirectMemoryPointer pointer , int offset ) { } public byte [ ] getBinaryValue ( ODirectMemoryPointer pointer , int offset , int len ) { } public short getShortValue ( ODirectMemoryPointer pointer , int offset ) { } public int getIntValue ( ODirectMemoryPointer pointer , int offset ) { } public long getLongValue ( ODirectMemoryPointer pointer , int offset ) { int end = offset + ( OLongSerializer . LONG_SIZE ) ; final List < OWALChangesTree . Node > result = new ArrayList < OWALChangesTree . Node > ( ) ; findIntervals ( root , offset , end , result ) ; if ( ( result . isEmpty ( ) ) && ( pointer != null ) ) return pointer . getLong ( offset ) ; byte [ ] value ; if ( pointer != null ) value = pointer . get ( offset , LONG_SIZE ) ; else value = new byte [ OLongSerializer . LONG_SIZE ] ; applyChanges ( value , offset , end , result ) ; <START_BUG> return INSTANCE . deserializeNative ( value , offset ) ; <END_BUG> } public void add ( byte [ ] value , int start ) { } private void add ( byte [ ] value , int start , int version , boolean updateSerializedSize ) { } public void applyChanges ( byte [ ] values , int start ) { } public int serializedSize ( ) { } public int serializedSize ( int content ) { } private void applyChanges ( byte [ ] values , int start , int end , List < OWALChangesTree . Node > result ) { } public void applyChanges ( ODirectMemoryPointer pointer ) { } public OWALChangesTree . PointerWrapper wrap ( final ODirectMemoryPointer pointer ) { } public int getSerializedSize ( ) { } public int fromStream ( int offset , byte [ ] stream ) { } public int toStream ( int offset , byte [ ] stream ) { } private int toStream ( OWALChangesTree . Node node , int offset , byte [ ] stream ) { } private void applyChanges ( ODirectMemoryPointer pointer , OWALChangesTree . Node node , Queue < OWALChangesTree . Node > processedNodes ) { } private void assertInvariants ( ) { } private boolean allBlackPathsAreEqual ( ) { } private void calculateBlackPathsFromNode ( OWALChangesTree . Node node , List < OModifiableInteger > paths , OModifiableInteger currentPath ) { } private boolean redHaveBlackChildNodes ( ) { } private boolean redHaveBlackChildNodes ( OWALChangesTree . Node node ) { } private boolean rootIsBlack ( ) { } private boolean maxEndIsPresent ( ) { } private boolean maxEndIsPresent ( OWALChangesTree . Node node ) { } private boolean endValueIsPresentAmongChildren ( int value , OWALChangesTree . Node node ) { } private boolean maxEndValueIsCorrect ( ) { } private boolean maxEndValueIsCorrect ( OWALChangesTree . Node node ) { } private boolean valueIsMaxEndValueAmongChildren ( OWALChangesTree . Node node , int value ) { } private void findIntervals ( OWALChangesTree . Node node , int start , int end , List < OWALChangesTree . Node > result ) { } private OWALChangesTree . Node bsearch ( int start ) { } private void insertCaseOne ( OWALChangesTree . Node node ) { } private void insertCaseTwo ( OWALChangesTree . Node node ) { } private void insertCaseThree ( OWALChangesTree . Node node ) { } private void insertCaseFour ( OWALChangesTree . Node node ) { } private void rotateRight ( OWALChangesTree . Node node ) { } private void rotateLeft ( OWALChangesTree . Node node ) { } private void updateMaxEndAccordingToChildren ( OWALChangesTree . Node node ) { } private void insertCaseFive ( OWALChangesTree . Node node ) { } private OWALChangesTree . Node grandparent ( OWALChangesTree . Node node ) { } private OWALChangesTree . Node uncle ( OWALChangesTree . Node node ) { } private void updateMaxEndAfterAppend ( OWALChangesTree . Node node ) { } private static final class Node { private boolean color ; private byte [ ] value ; private int version ; private int start ; private int end ; private int maxEnd ; private OWALChangesTree . Node parent ; private OWALChangesTree . Node left ; private OWALChangesTree . Node right ; public Node ( byte [ ] value , int start , boolean color , int version ) { } private boolean overlapsWith ( OWALChangesTree . Node other ) { } private boolean overlapsWith ( int start , int end ) { } } public final class PointerWrapper { private final ODirectMemoryPointer pointer ; private PointerWrapper ( ODirectMemoryPointer pointer ) { } public byte getByte ( long offset ) { } public short getShort ( long offset ) { } public int getInt ( long offset ) { } public long getLong ( long offset ) { } public byte [ ] get ( long offset , int len ) { } public char getChar ( long offset ) { } } }

Fix:
return INSTANCE . deserializeNative ( value , 0 ) ;