Skip to content

Commit

Permalink
Unit Test for java.util.stream (#305), addresses #302
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurangkudale authored Jan 13, 2022
1 parent f8b4549 commit e94c695
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/tests/java8/StreamTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package java8;

import gov.nasa.jpf.util.test.TestJPF;
import java.util.function.Supplier;
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class StreamTest {
public static List<String> allToUpperCase(List<String> words) {
return words.stream()
.map(string -> string.toUpperCase())
.collect(Collectors.toList());
}

@Test
public void multipleWordsToUppercase() {
List<String> input = Arrays.asList("a", "b", "hello");
List<String> result = allToUpperCase(input);
assertEquals(asList("A", "B", "HELLO"), result);
}
private void assertEquals(Object asList, List<String> result) {
}


private Object asList(String string, String string2, String string3) {
return null;
}
}

0 comments on commit e94c695

Please sign in to comment.