Java Utililty Methods List Remove

List of utility methods to do List Remove

Description

The list of methods to do List Remove are organized into topic(s).

Method

ListremoveEmpties(List original)
Simple removes empty string from given list
List<String> l = new ArrayList<>(original);
l.removeAll(Arrays.asList("", null));
return l;
ListremoveEmpty(List strings)
Removes empty strings from the given list
List<String> result = new ArrayList<String>();
for (String string : strings) {
    if (string.length() > 0)
        result.add(string);
return result;
ListremoveEmptyColumns(List data)
remove Empty Columns
if (firstColumnRemovable(data) == false) {
    return data;
final List<String> result = new ArrayList<String>(data);
do {
    removeFirstColumn(result);
} while (firstColumnRemovable(result));
return Collections.unmodifiableList(result);
...
voidremoveEmptyLines(List lines)
Removes empty lines from the vector.
removeEmptyLines(lines, true);
voidremoveEmptyLinesFromEnd(List list)
remove Empty Lines From End
while ("".equals(list.get(list.size()).toString())) {
    list.remove(list.size());
voidremoveEmptyLinesOnSides(List lines)
remove Empty Lines On Sides
while (lines.size() > 0 && lines.get(0).trim().length() == 0)
    lines.remove(0);
while (lines.size() > 0 && lines.get(lines.size() - 1).trim().length() == 0)
    lines.remove(lines.size() - 1);
voidremoveEmptyLists(Map map)
remove Empty Lists
for (Iterator<Map.Entry<String, Object>> it = map.entrySet().iterator(); it.hasNext();) {
    Map.Entry<String, Object> entry = it.next();
    if (entry.getValue() == null) {
        it.remove();
    } else if (entry.getKey().equals("coordinates")) { 
        it.remove();
    } else if (entry.getValue() instanceof List) {
        if (((ArrayList<?>) entry.getValue()).size() == 0) {
...
voidremoveEmptyStringsFromList(List list)
remove Empty Strings From List
list.removeAll(Collections.singleton(null));
list.removeAll(Collections.singleton(""));
ListremoveEmptyStringsInList(List list)
remove Empty Strings In List
List<String> newList = new ArrayList<String>();
for (String s : list) {
    if (!s.isEmpty()) {
        newList.add(s.trim());
return newList;
CollectionremoveEmptyTags(List tags)
remove Empty Tags
ArrayList<String> result = new ArrayList<String>(tags.size());
for (String tag : tags) {
    if (!(tag.length() < 1 || tag.equals(" "))) { 
        result.add(tag);
return result;