Add MatchGroupIdAndPackage rule

Works but really need to include more dependencies so that it is easier to write junit test codes.

See commit messages for details.