check if string contains same character java