import java.net.URL;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

public class PCAIL_Sample {
    PCAIL_Sample smpl;

    public void testBasicCase() {
        for (int i = 0; i < 10; i++) {
            PCAIL_Sample sample = new PCAIL_Sample();
            URL u = sample.getClass().getResource("/foo");
        }
    }

    public void fpPutField() {
        for (int i = 0; i < 10; i++) {
            PCAIL_Sample sample = new PCAIL_Sample();
            URL u = sample.getClass().getResource("/foo");
            if (i == 0)
                smpl = sample;
        }
    }

    public void fpTwoRegs() {
        for (int i = 0; i < 10; i++) {
            PCAIL_Sample sample = new PCAIL_Sample();
            URL u = sample.getClass().getResource("/foo");
            PCAIL_Sample s2 = sample;
        }
    }

    public PCAIL_Sample fpReturnAlloc() {
        for (int i = 0; i < 10; i++) {
            PCAIL_Sample sample = new PCAIL_Sample();
            URL u = sample.getClass().getResource("/foo");
            if (u != null)
                return sample;
        }

        return null;
    }

    public void fpMethodParm() {
        for (int i = 0; i < 10; i++) {
            PCAIL_Sample sample = new PCAIL_Sample();
            if (sample.equals(sample)) {
                return;
            }
        }
    }

    public List<PCAIL_Sample> fpAnonymousMethodParm() {
        List<PCAIL_Sample> col = new ArrayList<PCAIL_Sample>();
        for (int i = 0; i < 10; i++) {
            col.add(new PCAIL_Sample());
        }

        return col;
    }

    public List<PCAIL_Sample> fpAnonymousBuilder() {
        List<PCAIL_Sample> col = new ArrayList<PCAIL_Sample>();
        for (int i = 0; i < 10; i++) {
            col.add(new PCAIL_Sample().builder());
        }

        return col;
    }

    public void fpArrayStore() {
        PCAIL_Sample[] samples = new PCAIL_Sample[3];
        for (int i = 0; i < 3; i++)
            samples[i] = new PCAIL_Sample();
    }

    public void fpThrow() {
        for (int i = 0; i < 3; i++) {
            if (i == 3)
                throw new RuntimeException();
        }
    }

    public void fpTwoAssigns() {
        for (int i = 0; i < 10; i++) {
            Set<String> s;

            if ((i % 2) == 0)
                s = new HashSet<String>();
            else
                s = new TreeSet<String>();

            s.add(String.valueOf(i));
        }
    }

    public void fpChaining() {
        List<Foo> list = new ArrayList<Foo>();
        for (int i = 0; i <= 10; i++) {
            list.add(new Foo().withNumber(i));
        }
    }

    public List<String> fpPreUse() {
        List<String> l = null;

        while (true) {
            if (l != null) {
                return l;
            }

            l = new ArrayList<String>();
            l.add("Foo");

            for (String s : l) {
                System.out.println(s);
            }
        }
    }

    private PCAIL_Sample builder() {
        return this;
    }

    static class Foo {
        public Foo withNumber(int i) {
            return this;
        }
    }
}

@@ -3009,24 +3009,374 @@
      %7D%0A    %7D
+%0A    %0A    public String fpSwitch(List%3CString%3E ss, int i) %7B%0A    %09for (String s : ss) %7B%0A    %09%09switch (i) %7B%0A%09    %09%09case 0:%0A%09    %09%09%09List%3CString%3E n = new ArrayList%3CString%3E();%0A%09    %09%09%09n.add(s);%0A%09    %09%09%09if (n.isEmpty()) %7B%0A%09    %09%09%09%09return %22yup%22;%0A%09    %09%09%09%7D%0A%09    %09%09break;%0A%09    %09%09%0A%09    %09%09case 1:%0A%09    %09%09%09return null;%0A    %09%09%7D%0A    %09%7D%0A    %09%0A    %09return null;%0A    %7D
 %0A%0A    privat

add fp for pcail with switch statements