/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		List<Bar> list = new ArrayList<Bar>();
		list.add(new Bar());
		Ideone.hoge(list);
	}
	
	static <T extends Foo> void hoge(List<T> list) {
		list.get(0).p();
	}
	
	static interface Foo {
		void p();
	}
	static class Bar implements Foo {
		public Bar() {}
		@Override
		public void p() { System.out.println("p"); }
	}
	

	
	
}