All pastes #923950 Raw Edit

Unnamed

public java v1 · immutable
#923950 ·published 2008-02-29 23:39 UTC
rendered paste body
import java.util.ArrayList;import java.util.List;public class Main {		public static void main(String[] args) {		Main m = new Main();		List<String> names = m.executeCommand(new GetNamesCommand());		System.out.println(names);	}		private <R> R executeCommand(Command<R> command) {		return command.execute();	}}abstract class Command<R> {		public abstract R execute();}class GetNamesCommand extends Command<List<String>> {		public List<String> execute() {		List<String> names = new ArrayList<String>();		names.add("one");		names.add("two");		names.add("three");		return names;	}	}