A lambda supplies the behavior of one abstract method. The receiving functional interface determines its parameter and return types, so the same short expression can have different meanings under different contracts. Start by naming that contract. An IntPredicate answers a yes-or-no question; an IntUnaryOperator transforms an integer.
You can capture an effectively final threshold from the enclosing method. Keep captured values as configuration rather than changing them during traversal. Composition also has an order: adding a correction and then doubling produces a different result from doubling first. These tasks separate the small rule from the loop that applies it, then check boundary values, blanks and empty batches.