Here you can find the source of removeBlankLine(List
public static List<String> removeBlankLine(List<String> lines)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static List<String> removeBlankLine(List<String> lines) { List<String> result = new ArrayList<String>(); for (String line : lines) { if (line == null) { continue; }//from ww w. j ava 2s . c o m String temp = line.trim(); if (temp.length() == 0) { continue; } result.add(line); } return result; } }