This is the kind of problem where stepping through your code with a debugger is by far the best way to figure things out.
Also, you need to be a LOT more precise than "the collision just doesn't work" if you want us to be able to help you.
But just from skimming your code, the part that jumps out to me as puzzling are the four blocks like this:
if(playerSprite.getPosition().x + 16 > screenDimensions.x / 2)
position.x = playerSprite.getPosition().x + 16;
else
position.x = screenDimensions.x / 2;
This looks like it means "if player is 16 pixels from the right edge, move 16 to the right, and if not,
move him to the center of the screen". Is that really what you were after?