public abstract static class MapBlock { public Object[] run(Object[] list) { Object[] out = new Object[list.length]; // begin loop through list for (int i = 0; i < list.length; i++) { // call processElement on ourself and collect element returned Object new_obj = this.processElement(list[i]); out[i] = new_obj; } return out; } public abstract Object processElement(Object obj); // This might alternatively return an Object array for greater flexibility. // 'run' would require slight alterations to deal with an array coming back. // Thanks for the idea to [jdporter] }