Here you can find the source of join(Stream
public static String join(Stream<String> vals)
//package com.java2s; //License from project: Open Source License import static java.util.stream.Collectors.*; import java.util.stream.Stream; public class Main { public static String join(Stream<String> vals) { return vals.filter(s -> s != null).collect(joining()); }/*from ww w . ja v a 2 s .co m*/ }