Skip to content

Instantly share code, notes, and snippets.

@theboreddev
Created July 1, 2020 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theboreddev/dbaa2abdd3f4bf69fdd66a7c0c94f86d to your computer and use it in GitHub Desktop.
Save theboreddev/dbaa2abdd3f4bf69fdd66a7c0c94f86d to your computer and use it in GitHub Desktop.
sequential
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