import android.app.Activity;
import android.content.Context;
import android.content.Intent;

public class TestStartActivityToGetIntent {

    static Object source(String kind) {
        return null;
    }

    static void sink(Object sink) {}

    public void test(Context ctx, Activity act) {

        // test methods that start an activity
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("ctx-start"));
            ctx.startActivity(intent);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("act-start"));
            act.startActivity(intent);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("start-for-result"));
            act.startActivityForResult(intent, 0);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("start-if-needed"));
            act.startActivityIfNeeded(intent, 0);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("start-matching"));
            act.startNextMatchingActivity(intent);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("start-from-child"));
            act.startActivityFromChild(null, intent, 0);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("start-from-frag"));
            act.startActivityFromFragment(null, intent, 0);
        }

        // test 4-arg Intent constructor
        {
            Intent intent = new Intent(null, null, null, SomeActivity.class);
            intent.putExtra("data", (String) source("4-arg"));
            ctx.startActivity(intent);
        }

        // safe test
        {
            Intent intent = new Intent(null, SafeActivity.class);
            intent.putExtra("data", "safe");
            ctx.startActivity(intent);
        }
    }

    static class SomeActivity extends Activity {

        public void test() {
            sink(getIntent().getStringExtra("data")); // $ hasValueFlow=ctx-start hasValueFlow=act-start hasValueFlow=start-for-result hasValueFlow=start-if-needed hasValueFlow=start-matching hasValueFlow=start-from-child hasValueFlow=start-from-frag hasValueFlow=4-arg
        }

    }

    static class SafeActivity extends Activity {

        public void test() {
            sink(getIntent().getStringExtra("data")); // Safe
        }
    }
}

@@ -304,16 +304,20 @@
 // test 
+all 
 methods 
@@ -664,58 +664,566 @@
 ce(%22
-act-start%22));%0A            act.startActivity(intent
+ctx-start-acts%22));%0A            Intent%5B%5D intents = new Intent%5B%5D %7Bintent%7D;%0A            ctx.startActivities(intents);%0A        %7D%0A        %7B%0A            Intent intent = new Intent(null, SomeActivity.class);%0A            intent.putExtra(%22data%22, (String) source(%22act-start%22));%0A            act.startActivity(intent);%0A        %7D%0A        %7B%0A            Intent intent = new Intent(null, SomeActivity.class);%0A            intent.putExtra(%22data%22, (String) source(%22act-start-acts%22));%0A            Intent%5B%5D intents = new Intent%5B%5D %7Bintent%7D;%0A            act.startActivities(intents
 );%0A 
@@ -3085,16 +3085,81 @@
 ow=4-arg
+ MISSING: hasValueFlow=ctx-start-acts hasValueFlow=act-start-acts
 %0A       

add missing expectation to tests