Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.*;

import java.util.function.Predicate;

public class Main {
    static <E> List<E> filter(List<E> elements, Predicate<E> filter) {
        //TODO Implement me
        List<E> value = new ArrayList<>();
        for (E element : elements) {
            if (!filter.equals(element)) {
                value.add(element);
            }
        }
        return value;
    }
}