Created
July 31, 2015 07:11
-
-
Save sebastianmonte/69041da00f5bf1687115 to your computer and use it in GitHub Desktop.
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.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