The bug was caused by the mocking logic in Region.getAttributes(), which lazily initializes the RegionAttributes upon first access, and by extension, the Region AttributesMutator only gets intialized after the Region.getAttributes() method is invoked. Therefore, if Region.getAttributesMutator() is called before Region.getAttributes() and any AttributesMutator method is invoked then a NullPointerException is thrown.