User.java class updated

Also some test written for User.java class and gitignore file updated.