If I need to use InfoName as the key of a HashMap, do I need to define my own hashCode() and equals() method? I think it's not necessary, since the String name variable will be enough to make sure each object of InfoName is different.  
public class InfoName {
    enum Type {
        company, product;
    }
    public String name;
    public Type type;
    public InfoName(String name, Type type) {
        this.name = name;
        this.type = type;
    }
}
 
     
     
     
     
    