Skip to content

Instantly share code, notes, and snippets.

@rjeli
Created June 14, 2016 20:31
Show Gist options
  • Save rjeli/f019c4fcbc7bf02c250959a494d592ac to your computer and use it in GitHub Desktop.
Save rjeli/f019c4fcbc7bf02c250959a494d592ac to your computer and use it in GitHub Desktop.
package com.eli.testproject;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class Test {
public static void main(String[] args) {
List<Integer> nums = new ArrayList<>();
List<Box<Integer>> featurizedStream = nums
.stream()
.map(x -> new Box(x))
.collect(Collectors.toList());
}
private static class Box<T> {
Box(T item) {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment