Happened to me, snorkeling alone off Heron Island on the GBR. Sand Tiger passed perpendicular to me at about a 15 foot distance. The shark was only about 5-1/2 feet long, but I turned and swam as smoothly as I could back to shore, which can be a challenge when you're looking over your shoulder every few seconds!
The first thing that occurs to you -- at least it did to me -- is that you're out of your element and in their hunting ground.
Humpbacks are only a risk because of size. Orcas and sharks, quite another thing entirely.
Blackfish Official Film Site