Extract serviceMappingKeys to a method

Extract serviceMappingKeys to a method
Merge pull request #1531 from CarlosManias/java-fix-tests-and-cleanup

Extract serviceMappingKeys to a method