fork(2) download
  1. import java.util.Arrays;
  2. import java.util.Collections;
  3. import java.util.List;
  4.  
  5. import static java.util.stream.Collectors.toList;
  6.  
  7. class Ideone {
  8.  
  9. public static void main(String[] args) {
  10. String[] sa = {"ne", "two", "three"};
  11. List<String> l = Arrays.stream(sa)
  12. .flatMap(s -> Collections.singleton(s).stream().map(c -> c.toUpperCase()))
  13. .collect(toList());
  14. System.out.println(l.get(0));
  15. }
  16. }
Success #stdin #stdout 0.23s 320832KB
stdin
Standard input is empty
stdout
NE