Note: Style changes here were done specifically to conform with the Android Style formatter