package ua.ikonovalov;

import java.util.List;

/**
 * Created by Strong on 20.03.19.
 */
public class Analize {



    public Info diff(List<User> previous, List<User> current) {
        List<User> prev;
        List<User> cur;

    }

    public static class User {
        int id;
        String name;

        public User(int id, String name) {
            this.id = id;
            this.name = name;
        }

        @Override
        public int hashCode() {
            int result = id;
            result = 31 * result + (name != null ? name.hashCode() : 0);
            return result;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            User user = (User) o;

            if (id != user.id) return false;
            return name != null ? name.equals(user.name) : user.name == null;

        }

        @Override
        public String toString() {
            return "User{" +
                    "id=" + id +
                    ", name='" + name + '\'' +
                    '}';
        }
    }

    public static class Info {

        private int added;
        private int changed;
        private int deleted;

        public Info(int added, int changed, int deleted) {
            this.added = added;
            this.changed = changed;
            this.deleted = deleted;
        }

        public int getAdded() {
            return added;
        }

        public int getChanged() {
            return changed;
        }

        public int getDeleted() {
            return deleted;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Info info = (Info) o;

            if (added != info.added) return false;
            if (changed != info.changed) return false;
            return deleted == info.deleted;

        }

        @Override
        public int hashCode() {
            int result = added;
            result = 31 * result + changed;
            result = 31 * result + deleted;
            return result;
        }
    }
}

@@ -196,16 +196,27 @@
 er%3E prev
+ = previous
 ;%0A      
@@ -231,16 +231,47 @@
 ser%3E cur
+ = current;%0A        return null
 ;%0A%0A    %7D
@@ -719,32 +719,50 @@
   if (this == o)
+ %7B%0A               
  return true;%0A  
@@ -751,32 +751,46 @@
    return true;%0A
+            %7D%0A
             if (
@@ -826,37 +826,69 @@
 getClass()) 
-return false;
+%7B%0A                return false;%0A            %7D
 %0A%0A          
@@ -943,29 +943,61 @@
 ser.id) 
-return false;
+%7B%0A                return false;%0A            %7D
 %0A       
@@ -1158,18 +1158,16 @@
  %22User%7B%22
- +
 %0A       
@@ -1178,16 +1178,18 @@
         
+ +
  %22id=%22 +
@@ -1191,18 +1191,16 @@
 d=%22 + id
- +
 %0A       
@@ -1211,16 +1211,18 @@
         
+ +
  %22, name
@@ -1238,18 +1238,16 @@
 e + '%5C''
- +
 %0A       
@@ -1258,16 +1258,18 @@
         
+ +
  '%7D';%0A  
@@ -1877,28 +1877,60 @@
 s == o) 
-return true;
+%7B%0A                return true;%0A            %7D
 %0A       
@@ -1979,29 +1979,61 @@
 lass()) 
-return false;
+%7B%0A                return false;%0A            %7D
 %0A%0A      
@@ -2102,76 +2102,140 @@
 ed) 
-return false;%0A            if (changed != info.changed) return false;
+%7B%0A                return false;%0A            %7D%0A            if (changed != info.changed) %7B%0A                return false;%0A            %7D
 %0A   

process task #10