Test for immutable class with public fields

Sorry, this should have been my former pull request.