@SuppressWarnings("unchecked")
    static <T, U> Seq<U> ofType(Stream<? extends T> stream, Class<? extends U> type) {
        return seq(stream).filter(type::isInstance).map(t -> (U) t);
    }
Keep only those elements in a stream that are of a given type.
<p>
<pre><code>
// (1, 2, 3)
Seq.of(1, "a", 2, "b", 3).ofType(Integer.class)
</code></pre>
jOOL-java-8/src/main/java/org/jooq/lambda/Seq.java