FYI: One Starbucks 'grande' coffee contains almost your entire 'daily safe dose' of caffeine
The recommended daily limit of caffeine for an adult is 400 milligrams; a 16-ounce Starbucks brewed coffee has 330 milligrams. (A 2-ounce shot of 5-hour Energy has 215 milligrams, by the way.) There are more drink/caffeine comparisons on the chart at businessinsider.com, linked below.
I generally have a few personal mugs of Starbucks brewed coffee every day (5 or 6 on some days) -- so I no doubt exceed the daily limit by far. And yet I generally sleep just fine.