Add unit tests for getNextBytes method