test reducer and mapper