package com.mssngvwls;

public class Phrase {

    private String fullPhrase;
    private Category category;

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = (prime * result) + ((category == null) ? 0 : category.hashCode());
        result = (prime * result) + ((fullPhrase == null) ? 0 : fullPhrase.hashCode());
        return result;
    }

    @Override
    public boolean equals(final Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Phrase other = (Phrase) obj;
        if (category == null) {
            if (other.category != null) {
                return false;
            }
        } else if (!category.equals(other.category)) {
            return false;
        }
        if (fullPhrase == null) {
            if (other.fullPhrase != null) {
                return false;
            }
        } else if (!fullPhrase.equals(other.fullPhrase)) {
            return false;
        }
        return true;
    }

    public String getFullPhrase() {
        return fullPhrase;
    }

    public void setFullPhrase(final String fullPhrase) {
        this.fullPhrase = fullPhrase;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(final Category category) {
        this.category = category;
    }
}
@@ -21,30 +21,103 @@
 s;%0A%0A
-public class Phrase %7B%0A
+import java.util.UUID;%0A%0Apublic class Phrase %7B%0A%0A    private final UUID uuid = UUID.randomUUID();
 %0A   
@@ -343,16 +343,26 @@
 ategory.
+getUuid().
 hashCode
@@ -803,16 +803,17 @@
      if 
+(
 (categor
@@ -823,32 +823,116 @@
 = null) 
-%7B%0A            if
+&& (other.category != null)) %7B%0A            return false;%0A        %7D%0A        if ((category != null) &&
  (other.
@@ -940,31 +940,28 @@
 ategory 
-!
+=
 = null)
+)
  %7B%0A
-    
         
@@ -990,42 +990,91 @@
     
+%7D%0A
     
-%7D%0A
     
-    %7D else if (!category
+if ((category != null) && (other.category != null) && !category.getUuid()
 .equ
@@ -1091,16 +1091,26 @@
 category
+.getUuid()
 )) %7B%0A   
@@ -1379,32 +1379,254 @@
 rn true;%0A    %7D%0A%0A
+    @Override%0A    public String toString() %7B%0A        return %22Phrase %5Buuid=%22 + uuid + %22, fullPhrase=%22 + fullPhrase + %22, category=%22 + category.toString() + %22%5D%22;%0A    %7D%0A%0A    public UUID getUuid() %7B%0A        return uuid;%0A    %7D%0A%0A
     public Strin

Fix StackOverflowError caused by circular reference in Phrase equals/hashCode methods