Maybe explain this in the javadoc. If layer.getBoundingBox(srs) fails, you generate a new BoundingBox and return that. Explain how you do this.