refactored FinderOfNextSmallestPrevLargest.java