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 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));
		}
	}
	
	static class Foo
	{
		public Foo withNumber(int i)
		{
			return this;
		}
	}
}

@@ -1160,32 +1160,556 @@
 ;%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09%0A
+%09public List%3CPCAIL_Sample%3E fpAnonymousMethodParm() %0A%09%7B%0A%09    List%3CPCAIL_Sample%3E col = new ArrayList%3CPCAIL_Sample%3E();%0A        for (int i = 0; i %3C 10; i++)%0A        %7B%0A            col.add(new PCAIL_Sample());%0A        %7D%0A        %0A        return col;%0A%09%7D%0A%09%0A%09   public List%3CPCAIL_Sample%3E fpAnonymousBuilder() %0A%09    %7B%0A%09        List%3CPCAIL_Sample%3E col = new ArrayList%3CPCAIL_Sample%3E();%0A%09        for (int i = 0; i %3C 10; i++)%0A%09        %7B%0A%09            col.add(new PCAIL_Sample().builder());%0A%09        %7D%0A%09        %0A%09        return col;%0A%09    %7D%0A%09%0A
 %09public void fpA
@@ -2334,16 +2334,75 @@
 %09%7D%0A%09%7D%0A%09%0A
+%09private PCAIL_Sample builder() %0A%09%7B%0A%09    return this;%0A%09%7D%0A%09%0A
 %09static 

add more fp tests