Also interestingly, Puerto Rican and Latino votes for Trump actually increased[2] fueled primarily by economic and governance concerns. That joke ultimately didn't seem to have a negative impact, if any. Contrast Biden calling Americans garbage, which simply added more fuel to the furor behind Trump and Republicans.
As for the hypothetical question: If someone joked Japan is a floating island of garbage and there is actual basis for that criticism, I would take that as a cue to man up and make myself and my homeland great again so I can look at the joker in the eye with results.
[1]: https://en.wikipedia.org/wiki/File:Percent_population_below_...
But hey, that's just me.
If someone makes a baseless joke then they aren't worth the time of day, I agree with that.
To expand on the hypothetical question: Japan has a literal garbage island (it's an artificial island used as a landfill). We call it Dream Island (Yume no Shima) because of the irony.
Further reading: https://en.wikipedia.org/wiki/Yumenoshima
I'd be curious what your gut reaction was to the comedian that Trump's team hired to open at his rally at Madison Square Garden, just this past week, who referred to Puerto Rico as "a floating island of garbage" (starts at about 0:16):
https://www.youtube.com/watch?v=LNBdYplmKcI
Would your reaction be the same if he had referred to, say, Japan in the same way?