Skip to content

Instantly share code, notes, and snippets.

Last active May 29, 2017
What would you like to do?
import java.util.List;
import static*;
public class Prueba {
public static void main(String[] args) {
Integer i=getInt(new Integer(2));
int j=getInteger(3);
System.out.println(idsToStringList(new Person(i),new Person(j)));
idsToString(new Person(i),new Person(j)).forEach(System.out::println);
public static int getInt(int i) {
return i;
public static Integer getInteger(Integer i) {
return i;
public static Stream<String> idsToString(Person ...persons) {
return Stream.of(persons).map(x -> Integer.toString(;
public static List<String> idsToStringList(Person ...persons) {
return Stream.of(persons)
.collect(mapping(x -> Integer.toString(,toList()));
class Person {
private int id=0;
public Person(Integer i) {;
public int id() {return id;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment