Updated FinderOfNextSmallestPrevLargest.java: added support for boundary
cases and negative numbers