Thanks for the patch, Chang!
Main change of the patch looks good, just some issues with the test. I'm not a fan of having the test reach into the bowels of a private variable in the class and modify it directly. To me that's sort of an invalid setup. Instead the test should be able to accomplish the task via normal interfaces, otherwise the reported bug doesn't exist. In this case we should be able to send appropriate allocate responses to convince the original code to accidentally grant a reduce container to a map and see that the new code does not do this. It may be simpler to mock up the AM protocol directly rather than using a MockRM to get it to grant the excess containers required.