public class Foo { void m(Object o) { boolean foo = o instanceof String; } }