I have a project in Java. First I need to create a collection with no duplicates in the name of object & its number, so I use the Set collection and this equals method:

```
public boolean equals(Object obj) {
    Course<?> c=(Course<?>)obj;
    return (c.number==number&& c.Name.equals(Name));
}

```

next ..i need to create collection of the same object but now i need to insure that only his name is not duplicate. so its a problem because i cant use two diffrents methods of equals 
what can i do??