Edit Added a test to check for the previous/next returning null when neither are available