@@ -0,0 +1,1559 @@
+package com.uber.nullaway;%0A%0Aimport com.google.errorprone.CompilationTestHelper;%0Aimport java.util.Arrays;%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.TemporaryFolder;%0A%0A/** Unit tests showing cases where NullAway is unsound. Useful for documentation purposes. */%0Apublic class NullAwayUnsoundnessTests %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 mapReassignUnsound() %7B%0A    defaultCompilationHelper%0A        .addSourceLines(%0A            %22Test.java%22,%0A            %22package com.uber;%22,%0A            %22import java.util.*;%22,%0A            %22public class Test %7B%22,%0A            %22  public void mapReassignUnsound(Map m, Object o) %7B%22,%0A            %22    if (m.containsKey(o)) %7B%22,%0A            %22      // NullAway is currently unsound for this case.  It ignores%22,%0A            %22      // the re-assignment of m and still assumes m.get(o) is non-null%22,%0A            %22      // on the subsequent line.%22,%0A            %22      m = new HashMap();%22,%0A            %22      m.get(o).toString();%22,%0A            %22    %7D%22,%0A            %22  %7D%22,%0A            %22%7D%22)%0A        .doTest();%0A  %7D%0A%7D%0A

Add test case for unsound map reassignment handling (#541)