refactored getAnnotations().
implementation now uses optional parameters instead of *args.