Paul Clapham wrote:True, you haven't implemented an equals() method. That means that your Dept class inherits its equals() method from Object, and therefore that two Dept objects are "equal" if and only if they are the same object.
But I don't understand your question. Or your code. You're asking about whether the add() method of Set notices when you add an object which is already in the set, but your code doesn't bother to find out. Which it could very easily. Read the documentation for Set's add() method and you will see.
Boris Romashov wrote:You can define this property by editing command object in the controller.
To be more exact I need to see your controller method.