Vectors and Limitting Velocity

Wondering what your guys’ thoughts on this might be:
So I have space ship flying around. I might write some code like this:

float acceleration;
Vector2 velocity;
Vector2 position;
//…
//…
velocity.add(acceleration);
position.add(velocity);

What would you propose I should do if I wanted to limit the maximum velocity? Currently, as you can see, velocity would add up to infinity since it keeps adding acceleration.

Maybe you might think I would write something like this?

velocity.add(acceleration);
if(velocity.getMagnitude() > maximumAllowableVelocity){
Vector2.normalize(velocity);
velocity.multiply(maximumAllowableVelocity();
}
position.add(velocity);

But even that does not get me what I am looking for. If you have been in a similar situation, do you remember what you did to resolve this issue? Thanks in advance.