sort(Comparator c, Method prepare) .... .... // The second map would then look something like this map(new Block() { protected Object process(Object elem) { ArrayList temp = new ArrayList(); temp.add(elem); try { temp.add(prepare.invoke(elem, null)); // or possibly with args; } catch (Exception e) { // for real we'd catch finer grained exceptions and // do something smart } }, in);