A simple map-reduce implementation in Java