Created
July 1, 2020 09:49
-
-
Save theboreddev/dbaa2abdd3f4bf69fdd66a7c0c94f86d to your computer and use it in GitHub Desktop.
sequential
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.theboreddev.sequential; | |
import com.theboreddev.Processor; | |
import java.util.List; | |
public class SequentialProcessor implements Processor { | |
@Override | |
public Integer process(List<Integer> input) { | |
return input | |
.stream() | |
.reduce(Integer::sum) | |
.orElse(0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment