Closes caelum/vraptor#581. Only instantiate objects with same type

Closes caelum/vraptor#581.