java string compare first n characters