if(name == tm.get(j))

Unless you have good reason otherwise, you should always use the equals method when comparing Strings.