Skip to content

Instantly share code, notes, and snippets.

@sebastianmonte
Created July 31, 2015 07:11
Show Gist options
  • Save sebastianmonte/69041da00f5bf1687115 to your computer and use it in GitHub Desktop.
Save sebastianmonte/69041da00f5bf1687115 to your computer and use it in GitHub Desktop.
package com.gofore.test;
import com.gofore.fixme.annotation.Fixme;
import java.util.List;
public class NumberAdder {
@Fixme(summary = "Use stream instead of loop")
public static int add(List<Integer> numbers) {
if (numbers.isEmpty()) {
throw new IllegalArgumentException("Numbers is empty");
}
int result = 0;
for (Integer i : numbers) {
result += i;
}
return result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment