Skip to content

Instantly share code, notes, and snippets.

@korzha
Created November 2, 2016 13:29
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 korzha/9dfa0ca5ccfed3def097aefc59ea1e32 to your computer and use it in GitHub Desktop.
Save korzha/9dfa0ca5ccfed3def097aefc59ea1e32 to your computer and use it in GitHub Desktop.
public class Scratch implements EntryPoint {
@Override
public void onModuleLoad() {
testStream(1, 2, 3);
}
private String createString(Integer n) {
return "" + n;
}
private void testStream(Integer... numbers) {
ArrayList<String> list = new ArrayList<>();
Stream.of(numbers).map(this::createString).forEach(list::add);
GWT.log(list.toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment