Instead of using `instanceof`, it would be better to do a `switch` on `geometry.getType()`. Within the `case`s, you can use `goog.asserts.assertInstanceof` and `setCoordinates` directly to get type checking.