@@ -0,0 +1,1439 @@
+package com.uber.nullaway.jdk17;%0A%0Aimport com.google.errorprone.CompilationTestHelper;%0Aimport com.uber.nullaway.NullAway;%0Aimport java.util.Arrays;%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.TemporaryFolder;%0A%0Apublic class NullAwayInstanceOfBindingTests %7B%0A%0A  @Rule public final TemporaryFolder temporaryFolder = new TemporaryFolder();%0A%0A  private CompilationTestHelper defaultCompilationHelper;%0A%0A  @Before%0A  public void setup() %7B%0A    defaultCompilationHelper =%0A        CompilationTestHelper.newInstance(NullAway.class, getClass())%0A            .setArgs(%0A                Arrays.asList(%0A                    %22-d%22,%0A                    temporaryFolder.getRoot().getAbsolutePath(),%0A                    %22-XepOpt:NullAway:AnnotatedPackages=com.uber%22));%0A  %7D%0A%0A  @Test%0A  public void testInstanceOfBinding() %7B%0A    defaultCompilationHelper%0A        .addSourceLines(%0A            %22InstanceOfBinding.java%22,%0A            %22package com.uber;%22,%0A            %22import javax.annotation.Nullable;%22,%0A            %22class InstanceOfBinding %7B%22,%0A            %22  public void testInstanceOfBinding(@Nullable Object o) %7B%22,%0A            %22    if (o instanceof String s) %7B%22,%0A            %22      s.toString();%22,%0A            %22      o.toString();%22,%0A            %22    %7D%22,%0A            %22    // BUG: Diagnostic contains: dereferenced expression o%22,%0A            %22    o.toString();%22,%0A            %22  %7D%22,%0A            %22%7D%22)%0A        .doTest();%0A  %7D%0A%7D%0A

Add a test of binding patterns (#583)