class LienzoShapeUtils {

    public static OptionalBounds translateBounds(final Bounds bounds) {
        final OptionalBounds result = OptionalBounds.createEmptyBounds();
        if (bounds.hasUpperLeft()) {
            final Bound upperLeft = bounds.getUpperLeft();
            if (upperLeft.hasX()) {
                result.setMinX(upperLeft.getX());
            }
            if (upperLeft.hasY()) {
                result.setMinY(upperLeft.getY());
            }
        }
        if (bounds.hasLowerRight()) {
            final Bound lowerRight = bounds.getLowerRight();
            if (lowerRight.hasX()) {
                result.setMaxX(lowerRight.getX());
            }
            if (lowerRight.hasY()) {
                result.setMaxY(lowerRight.getY());
            }
        }
        return result;
    }

}