Your code is fine, but with this method we can see that Java is too poor to work with properties. :(