Question: Can be obtain a File object from URL? I try something like 

```
URL url = new URL(urlString);
File file = Paths.get(url.toURI()).toFile();

```

but it obtained exception

```
java.nio.file.FileSystemNotFoundException: Provider "http" not installed

```

or https... depending on the protocol used. Assume that urlString contain a valid address.

Exist an altenative to get it the File object from URL or I'm on wrong way?

Answer: 
A [`Predicate<T>`](https://docs.oracle.com/javase/9/docs/api/java/util/function/Predicate.html) which you're currently using represents a predicate (boolean-valued function) **of one argument**.

You're looking for a [`BiPredicate<T,U>`](https://docs.oracle.com/javase/9/docs/api/java/util/function/BiPredicate.html) which essentially represents a predicate (boolean-valued function) **of two arguments**.

```
BiPredicate<Set<String>,String>  checkIfCurrencyPresent = (set,currency) -> set.contains(currency);

```

or with method reference:

```
BiPredicate<Set<String>,String> checkIfCurrencyPresent = Set::contains;

```
Aomine's answer is complete. using of `BiFunction<T, U, R>` is another way: 

```
BiFunction<Set<String>,String,Boolean> checkIfCurrencyPresent = Set::contains;

```