/** * Apply all {@code transformations} to the {@code plan}. * * @param transformations transformations to apply * @param epoch the new epoch * @return the number of applied transformations */ private int applyAndCountTransformations(Collection<PlanTransformation> transformations, int epoch) { return transformations.stream() .mapToInt(transformation -> transformation.transform(this, epoch)) .sum(); }