Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import java.util.Map;

import java.util.function.Predicate;
import java.util.stream.Collectors;

public class Main {
    public static <Key, Value> Collection<Value> filterMapValues(Map<Key, Value> map,
            Predicate<Map.Entry<Key, Value>> entryPredicate) {
        return map.entrySet().parallelStream().filter(entryPredicate).map(Map.Entry::getValue)
                .collect(Collectors.toList());
    }
}