Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: LGPL 

import java.util.Collection;

import java.util.Iterator;

public class Main {
    public static final <E, F extends Collection<E>> F removeNulls(F collection) {
        Iterator<E> iterator = collection.iterator();
        while (iterator.hasNext()) {
            if (iterator.next() == null) {
                iterator.remove();
            }
        }

        return collection;
    }
}