package ru.job4j.collections.test;

/**
 * This class describes department of the company.
 *
 * @author Kucykh Vasily (mailto:bail135@mail.ru)
 * @version $Id$
 * @since 17.05.2017
 */
public class Department {

    /**
     * parameter name is name of the department.
     */
    private final String name;

    /**
     * constructor of this class.
     *
     * @param name is name of this department
     */
    public Department(final String name) {
        this.name = name;
    }

    /**
     * method return name of this department.
     *
     * @return name
     */
    public String getName() {
        return this.name;
    }

    /**
     * method compare this department with object o and return true if they are equals.
     *
     * @param o is object we need compare to
     * @return true if this department equals to o
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Department that = (Department) o;

        return name.equals(that.name);
    }

    /**
     * method generate an integer number describes this department.
     *
     * @return integer number
     */
    @Override
    public int hashCode() {
        return name.hashCode();
    }

}
@@ -889,24 +889,25 @@
 Object o) %7B%0A
+%0A
         if (
@@ -916,16 +916,30 @@
 is == o)
+ %7B%0A           
  return 
@@ -944,16 +944,27 @@
 n true;%0A
+        %7D%0A%0A
         
@@ -1007,16 +1007,30 @@
 Class())
+ %7B%0A           
  return 
@@ -1035,16 +1035,26 @@
 n false;
+%0A        %7D
 %0A%0A      
@@ -1090,16 +1090,16 @@
 nt) o;%0A%0A
-
         
@@ -1129,16 +1129,17 @@
 .name);%0A
+%0A
     %7D%0A%0A 

Refactor Department.java