Here you can find the source of padWithNulls(final Collection
private static void padWithNulls(final Collection<String> s1, final Collection<String> s2)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { private static void padWithNulls(final Collection<String> s1, final Collection<String> s2) { if (s1.size() != s2.size()) { while (s1.size() < s2.size()) { s1.add(null);/*www .j a v a2 s . c om*/ } while (s1.size() > s2.size()) { s2.add(null); } } } }