1D Peak Finding Java