Functions1 { @Nonnull public static Func1<? super Object, Boolean> instanceOf(@Nonnull final Class clazz) { checkNotNull(clazz); return new Func1<Object, Boolean>() { @Override public Boolean call(Object o) { return clazz.isInstance(o); } }; }  @Nonnull static Func1<? super Boolean, Boolean> isTrue(); @Nonnull static Func1<? super Boolean, Boolean> isFalse(); @Nonnull static Func1<T, Boolean> neg(@Nonnull final Func1<T, Boolean> func1); @Nonnull static Func1<? super Object, Boolean> isNull(); @Nonnull static Func1<? super Object, Boolean> isNotNull(); @Nonnull static Func1<? super CharSequence, Boolean> isNullOrEmpty(); @Nonnull static Func1<? super Object, Boolean> instanceOf(@Nonnull final Class clazz); @Nonnull static Func1<? super Object, ?> toObject(); @Nonnull static Func1<? super Object, Void> toVoid(); @Nonnull static Func1<? super Boolean, ? extends Boolean> neg(); @Nonnull static Func1<Object, Boolean> returnFalse(); @Nonnull static Func1<Object, Boolean> returnTrue(); @Nonnull static Func1<Object, T> returnJust(final T value); @Deprecated @Nonnull static Func1<? super CharSequence, String> charSequenceToString(); @Nonnull static Func1<Object, String> toStringFunction(); @Nonnull static Func1<? super Object, Boolean> isEqualTo(@Nonnull final Object... values);  }
@Test public void testInstanceOf_StringFiltered() throws Exception { final TestSubscriber<Object> testSubscriber = new TestSubscriber<>(); Observable.just(1, "hello", 3d) .filter(Functions1.instanceOf(String.class)) .subscribe(testSubscriber); assert_().that(testSubscriber.getOnNextEvents()).containsExactly("hello"); }