Value extractor for Predicates
<p>In Java 8, the <code>Comparator</code> class has this <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#comparing-java.util.function.Function-java.util.Comparator-" rel="nofollow">really nifty static method</a> that composes a <code>Function</code> to a <code>Comparator</code> by using the the result of the <code>Function</code> as the input for the <code>Comparator</code>.</p>

<p>What I would like to do, is be able to compose <code>Function</code> objects with other types like <code>Predicate</code>, in order to make my code more readable, and to make my functional operations more powerful.</p>

<p>For example, say there is a <code>Set&lt;Person&gt;</code> where <code>Person</code> has a <code>public String getName()</code> method. I want to be able to filter out the <code>Person</code> objects that don't have a name. Ideally, the syntax would look like this:</p>

<pre><code>people.removeIf(Predicates.andThenTest(Person::getName, String::isEmpty));
</code></pre>

<p><em>Are there any built-in methods that can compose a <code>Function</code> with something like a <code>Predicate</code>?</em> I'm aware of <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html#andThen-java.util.function.Function-" rel="nofollow"><code>Function#andThen(Function)</code></a>, but that is only useful for combining functions with other functions, and sadly, <code>Predicate</code> doesn't <code>extend Function&lt;T, Boolean&gt;</code>.</p>

<p>P.S. I'm also aware that I could use a lambda like <code>p -&gt; p.getName().isEmpty()</code>, but I would like for a way to compose pre-existing <code>Predicate</code> objects with a <code>Function</code>.</p>