Recommendation of set operation by Java (and understanding of equals and hashCode)

Goal of this article

Those who want to read this article

After reading this article, the scene of utilizing the knowledge that is born

For example, you can easily compare the differences between CSV files. The difference comparison of table data is the same.

Sample code execution environment

Java 11

Effect of concrete set operation

An example of set operation is shown below.

論理積

排他的論理和

論理和

In addition to this, the difference set can also be obtained.

Previous knowledge

Object equivalence

There are two types of object equivalence in Java:

Object identity

In Java, identity can be verified by comparing the reference addresses of objects with ==.

Reference.java


Object object = new Object();
Object object2 = new Object();

object == object; // true
object == object2; // false

Object equivalence

The equals of the Object class that all objects inherit Equivalence can be determined by overriding.

Equals.java


Object object = new Object();
Object object2 = new Object();

object.equals(object); // true
object.equals(object2); // false

And a method called hashCode is deeply involved in this equals.

Java object equivalence evaluation mechanism

First, let's take a look at the equals JavaDoc.

equals JavaDoc equals (from Java8 Oracle HP)

Indicates whether this object is equal to other objects. equals method implements equivalence relations on non-null object references

Concrete example.java


object.equals(null); // false
  • Reflexive: For non-null reference values x, x.equals (x) returns true.

Let's look at each one.

Equals requirement: Reflective

  • Reflexive: For non-null reference values x, x.equals (x) returns true.

Same as the one illustrated in the object equivalence section.

Equals.java


object.equals(object); // true 

Equals requirement: symmetry

  • Symmetry: For non-null reference values x and y, x.equals (y) returns true only if y.equals (x) returns true.

Concrete example.java


Object object = new Object();
Object object2 = object;

object.equals(object2); // true
object2.equals(object); // true

Requirements for equals: transitive

  • For non-null reference values x, y, and z, x.equals (z) returns true if x.equals (y) returns true and y.equals (z) returns true. If A = B and B = C, then A = C.

Concrete example.java


Object A = new Object();
Object B = A;
Object C = A;

object.equals(object2); // true
object2.equals(object3); // true
//Object2 without comparison.equals(object3)Seems to return true.

Equals requirements: Consistency

  • Consistent: Multiple calls to x.equals (y) for non-null reference values x and y If the information used in the equals comparison for this object has not changed, it either consistently returns true or consistently returns false.

No matter how many times equals is executed, if the objects are equivalent, the same result will be returned.

Concrete example.java


object.equals(object); // true
object.equals(object); // true

Javadoc for Object # equals continued

The equals method of the Object class implements the equivalence relations of the most comparable objects. That is, for non-null reference values x and y, this method returns true only if x and y refer to the same object (x == y is true).

In other words, the equals of the Object class itself in the example above

Concrete example.java


object.equals(object2);

Is

Concrete example.java


object == object2;

Only the above identities are verified unless the class overrides equals.

For String # equals

For example, equals of java.lang.String class returns true first if identity can be confirmed, otherwise it verifies equivalence. Basically, when overriding, follow the flow of identity verification → equivalence verification.

String#equals.java


    public boolean equals(Object anObject) {
        if (this == anObject) { //Verification of identity
            return true;
        }
        //Equivalence verification
        if (anObject instanceof String) {
            String aString = (String)anObject;
            if (coder() == aString.coder()) {
                return isLatin1() ? StringLatin1.equals(value, aString.value)
                                  : StringUTF16.equals(value, aString.value);
            }
        }
        return false;
    }

Javadoc for Object # equals continued

Normally, when overriding this method, you should always override the hashCode method and follow the general convention of the hashCode method ** "equivalent objects must hold the equivalent hash code" **. Please note that there is **.

By the way, what is the general rule [^ 1] of hasCode? Shouldn't we just override the equals method in the first place?

hashCode JavaDoc hashCode (from Java8 Oracle HP)

Returns the hash code value of the object. This method is supported for the benefit of hash tables, such as the hash table provided by HashMap.

The hash is [Wikipedia: Hash Function](https://ja.wikipedia.org/wiki/%E3%83%8F%E3%83%83%E3%82%B7%E3%83%A5%E9%96 % A2% E6% 95% B0) is detailed.

It expresses the data identification key. Continue reading the Javadoc.

The general rules for hashCode are:

  • Whenever a Java application is run and is called multiple times for the same object, the hashCode method always returns the same integer unless the information used in the ** equals comparison for this object has changed. is needed**. However, this integer does not have to be the same for each run of the same application.

Is it the same as the consistency of equals in the previous stage?

  • If two objects are equal according to the * equals (Object) method **, then a call to the ** hashCode method for each of the two objects must produce the same integer result **.
  • If two objects are not equal according to the equals (java.lang.Object) method, then two Calling the hashCode method for each object does not have to produce different integer results. However, programmers will find that generating different integer results for unequal objects can improve the performance of hash tables. ** "Equivalent objects must hold equivalent hash code" **

The properties of the return values of equals and hashCode for the equivalence and non-equivalence of the two objects are summarized below.

Method Equivalent object Non-equivalent objects
hashCode Must be equivalent Non-equivalent recommended.
* It does not have to be non-equivalent, but it is recommended for performance.
equals Should return true Should return false

Quiet talk

By now, we know that object equivalence consists of both equals and hashCode. Of the classes we create, the targets that judge equivalence and handle in collections such as List, Map, and Set are thought to be POJOs (Plain Old Java Objects). Among POJOs, data is modeled, that is, DTO (Data Transfer Object), VO (Value Object), Entity (class that imitates table structure), some data with different names. In the expression of, the equivalence is judged by equals.

Options for implementing equals and hashCode in Java

Equals and hashCode will be overridden by POJO, but it is expected that the means will be as follows.

  1. Implementation by @EqualsAndHashCode annotation of library lombok
  2. Implementation by the source completion function of IDE such as eclipse
  3. Implemented by the developer

For 1 and 2, it is an implementation of equals that verifies whether the fields of that class and superclass are all equivalent.

Regarding 3, it seems that a method that verifies the same value will be created or the implementation will be based on special circumstances, but this article does not assume it and does not recommend it. 1 seems to be the representative.

Reconfirmation of collection API with awareness of equals and hashCode

The objects equals and hashCode are important in the collection API. Once again, we will confirm the involvement of equals and hashCode in the Collection API. Since it will be an introduction on the interface side, please refer to the Javadoc and select the implementation class as appropriate when using it.

List

Feature

A collection interface with an order. The implementation class is as follows in the standard implementation. There are implementations in many other libraries.

These are implemented based on the properties that are satisfied by the Javadoc of the List interface. Implementation details are different for each implementation class. For example, LinkedList has slow random access (access using subscripts), operation of tip / end elements is fast, and ArrayList has fast random access. Here, we will not touch on how to select each implementation class.

Single object operation: contains

boolean contains(Object o) Returns true if the specified element is included in this list. That is, it returns true only if this list contains one or more elements e that are (o == null? E == null: ** o.equals (e) **).

e is each element of List. As a result of verifying the equivalence with e in o.equals, if there is even one that returns true, it returns true.

In other words, the contains of the List ** uses the equals implementation of the passed object **. Some collection APIs use equals in operations on the elements held by the collection.

Single object operation: remove

boolean remove(Object o) If the specified element is in this list, remove the first one from the list (optional operation). If the element is not in this list, it will not be modified. That is, delete the element with the smallest index value i that is (o == null? Get (i) == null: ** o.equals (get (i)) **) (such element If exists). Returns true if the specified element was included in this list (that is, if this list was modified as a result of a call).

Same as contains and depends on the implementation of equals. It also describes the consideration when there are multiple objects that are equals.

Aggregate object manipulation: equals

boolean equals(Object o) Compares whether the specified object is equal to this list. ** Returns true only if the specified object is also a list **, ** of the same size **, and all corresponding elements of the two lists are equal **. The two elements e1 and e2 are equal if they are (e1 == null? E2 == null: ** e1.equals (e2) **). That is, the two lists are defined as ** equal if the same elements are included in the same order **. This definition ensures that the equals method works correctly with different implementations of the List interface.

It can be seen that the equals of List delegates the processing to the equals of the element class that List itself has.

For example, the following listA.equals (listB) section is

StringListEquals.java


List<String> listA = List.of("A", "B", "C");
List<String> listB = List.of("A", "B", "C");

listA.equals(listB); // true

Therefore, true is returned.

Set object operation: containsAll

boolean containsAll(Collection<?> c) Returns true if all elements of the specified collection are included in this list.

In the extension of contains, if the calling List contains all the elements of the argument c (the result of contains is true), true is returned.

In other words, it verifies that a set contains all the specified sets.

Set object operation: retainAll

boolean retainAll(Collection<?> c) Keeps only the elements contained in the specified collection in this list (optional operation). That is, it removes all elements not included in the specified collection from this list.

In other words, you get the product of a set and the specified set. Of course, if none are included, the calling List will be empty.

Collective object operations: removeAll

boolean removeAll(Collection<?> c) Removes all elements from the specified collection from this list (optional operation).

Extension of remove.

Set

Feature

A collection with no duplicate elements. That is, the set does not have an element pair of e1 and e2 that is ** e1.equals (e2) **, and has a maximum of one null element. As the name implies, this interface models the mathematical abstraction of sets.

A collection class that does not allow duplicate elements to be retained. The judgment of duplication is as shown in bold.

The idea of the method is the same as List. See Javadoc for details.

SortedSet

Feature

A Set that provides global ordering for that element. The ordering of the elements is done according to their natural ordering or using the Comparator normally provided when building the set. The set iterator traverses the set in ascending order of elements. Some additional operations are provided to take advantage of that ordering. (This interface is a set and is similar to SortedMap.)

The following are special notes [^ 2]

For a sort set to implement the Set interface correctly, the ordering maintained by that sort set must be consistent with equals, regardless of whether an explicit comparator is provided. Please note that you should not. (See the Compareable or Comparator interfaces for the exact definition of consistency with equals.) This is because the Set interface is defined based on the equals operation, but the sort set is its compareTo method or Since we use the compare method to perform all element comparisons, the two elements that are considered equivalent by this method are the same from the perspective of the sort set. The behavior of sort sets is well defined, even if their ordering is inconsistent with equals, but it does not comply with the general conventions of the Set interface.

SortedSet is a collection class that holds a class that implements the Comparable interface, The compareTo implemented in Comparable must be consistent with equals. In other words, if compareTo is 0 (the order matches), equals should return true.

Reference article Note because I was addicted to the Comparator of TreeSet (for beginners)

Map

Feature

So-called key, value dictionary class.

Set object operation: entrySet

public Set<Map.Entry<K,V>> entrySet() Returns a Set view of the mappings contained in this map. ** Since the set is linked to the map, changes to the map will be reflected in the set **, and changes to the set will be reflected in the map **. If the map is modified during a set iteration, the result of the iteration is undefined (except for the iterator's own remove operation or the setValue operation on the map entry returned by the iterator). The set supports the deletion of elements. Remove the corresponding mapping from the map with the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support add or addAll operations.

Set \ <Map.Entry \ <K, V > > is available in the For Each loop. It is shown that it is possible to operate in set units by acquiring all the elements of Map with Set.

Aggregate object manipulation: equals

boolean equals(Object o) Compares whether the specified object is equal to this map. The specified object is also a map and returns true if the two maps represent the same mapping. That is, if m1.entrySet (). Equals (m2.entrySet ()), the two maps m1 and m2 represent the same mapping. This ensures that the equals method works correctly even if the Map interface implementation is different.

Implementation example of concrete set operation Basic

theme

Set A image.png

Set B image.png

StringSetDiff.java



import java.util.HashSet;
import java.util.Set;

public class StringSetDiff {
    public static void main(String[] args) {
        Set<String> setA = Set.of("a","b","c");
        Set<String> setB = Set.of("b","c","d");

        //Union
        System.out.println("Union");
        Set<String> setAcopy = new HashSet<>(setA);
        Set<String> setBcopy = new HashSet<>(setB);
        setAcopy.addAll(setBcopy); //setB is added to the contents of setA
        setAcopy.forEach(System.out::print);
        System.out.println();

        //Difference set
        System.out.println("Difference set");
        setAcopy = new HashSet<>(setA);
        setBcopy = new HashSet<>(setB);
        setAcopy.removeAll(setBcopy); //Subtract setB from the contents of setA.
        setAcopy.forEach(System.out::print);
        System.out.println();

        //Intersection
        System.out.println("Intersection");
        setAcopy = new HashSet<>(setA);
        setBcopy = new HashSet<>(setB);
        setAcopy.retainAll(setBcopy); //Leave the contents that exist in setA and setB in setA
        setAcopy.forEach(System.out::print);
        System.out.println();

        //Exclusive OR
        System.out.println("Exclusive OR set");
        setAcopy = new HashSet<>(setA);
        setBcopy = new HashSet<>(setB);
        Set<String> setAcopy2 = new HashSet<>(setA);
        //First get the intersection
        setAcopy.retainAll(setBcopy);
        //Exclude the intersection from each set
        setAcopy2.removeAll(setAcopy);
        setBcopy.removeAll(setAcopy);
        setAcopy2.addAll(setBcopy);
        setAcopy2.forEach(System.out::print);
    }
}


Union

Add the B set to the A set.

Prediction of execution results image.png  +  image.png  =  image.png

Union.java


        Set<String> setA = Set.of("a","b","c");
        Set<String> setB = Set.of("b","c","d");
        Set<String> setAcopy = new HashSet<>(setA);
        Set<String> setBcopy = new HashSet<>(setB);
        setAcopy.addAll(setBcopy); //Set A + Set B

Execution result

abcd


Difference set

Subtract B set from A set

Prediction of execution results image.png  -  image.png  =  image.png

Difference set.java


        Set<String> setA = Set.of("a","b","c");
        Set<String> setB = Set.of("b","c","d");
        Set<String> setAcopy = new HashSet<>(setA);
        Set<String> setBcopy = new HashSet<>(setB);
        setAcopy.removeAll(setBcopy); //Set A-Set B

Execution result

a


Intersection

Get the elements in both the A and B sets.

Prediction of execution results image.png  ×  image.png  =  image.png

Intersection.java


        Set<String> setA = Set.of("a","b","c");
        Set<String> setB = Set.of("b","c","d");
        Set<String> setAcopy = new HashSet<>(setA);
        Set<String> setBcopy = new HashSet<>(setB);
        setAcopy.retainAll(setBcopy); //Set A*Set B

Execution result

bc


Exclusive OR set

Obtain an element that exists only in either the A set or the B set.

Prediction of execution results image.png  XOR  image.png  =  image.png

Exclusive OR set.java


        Set<String> setA = Set.of("a","b","c");
        Set<String> setB = Set.of("b","c","d");
        setAcopy = new HashSet<>(setA);
        setBcopy = new HashSet<>(setB);
        Set<String> setAcopy2 = new HashSet<>(setA);
        //First get the intersection
        setAcopy.retainAll(setBcopy); //Set A*Set B
        //Exclude the intersection from each set
        setAcopy2.removeAll(setAcopy); //Set A- (Set A*Set B)=Only set A exists
        setBcopy.removeAll(setAcopy); //Set B- (Set A*Set B)=Only set B exists
        setAcopy2.addAll(setBcopy); //Set A,A set that exists in only one of B

Execution result

ad

Implementation example of concrete set operation Development

Library used

build.gradle


dependencies {
    compile 'org.projectlombok:lombok:1.18.8'
    compile 'org.apache.commons:commons-lang3:3.7'

    compile 'org.slf4j:slf4j-api:1.7.25'
    compile 'ch.qos.logback:logback-classic:1.2.3'
}

Difference check for each object

Class to use

Record.java


import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;
import java.util.Comparator;
import java.util.UUID;


@Data
@EqualsAndHashCode
@ToString
@NoArgsConstructor
public class Record implements Comparable {
    private UUID primaryKey;
    private String name;
    private Integer age;

    //To make the output easier to see
    @Override
    public int compareTo(Object o) {
        if (o instanceof Record) {
            //age ascending order,name ascending order
            Comparator<Record> comparator =
                    Comparator.comparing(Record::getAge).
                            thenComparing(Record::getName).
                            thenComparing(Record::getPrimaryKey);
            return comparator.compare(this, (Record) o);
        }
        return 0;
    }

    //Return to record class from record class for change detection described later
    public Record(ModifiedRecord modifiedRecord) {
        try {
            BeanUtils.copyProperties(this, modifiedRecord);
        } catch (IllegalAccessException | InvocationTargetException  ex) {
            ex.printStackTrace();
        }
    }
    public Record(DeleteOrInsertRecord deleteOrInsertRecord) {
        try {
            BeanUtils.copyProperties(this, deleteOrInsertRecord);
        } catch (IllegalAccessException | InvocationTargetException ex) {
            ex.printStackTrace();
        }
    }
}

A class that imitates a so-called ordinary table record. By implementing Comparable, it became necessary to implement compareTo.

Precautions when implementing Comparable Objects whose result of compareTo is 0 are judged to be equivalent even on collections with TreeSet order. For this reason, if you add multiple objects that return 0 with compareTo to the TreeSet as shown in this sample, one of them disappears. In the Record class, null check is not performed for each field, so null check is also required for actual operation.

DeleteOrInsertRecord.java


import lombok.Data;

import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;
import java.util.UUID;

/**
 *Record for new / deleted detection.
 * <pre>
 *This VO implements equivalence for classifying new / deleted masters.
 *The equals method is used to determine equivalence{@code age, name}Does not include.
 * </pre>
 */
@Data
@NoArgsConstructor
@ToString
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class DeleteOrInsertRecord {

    @EqualsAndHashCode.Include
    private UUID primaryKey;

    private Integer age;

    private String name;

    public DeleteOrInsertRecord(Record record) {
        try {
            BeanUtils.copyProperties(this, record);
        } catch (IllegalAccessException | InvocationTargetException e) {
            e.printStackTrace();
        }
    }
}

Record class that performs equivalence judgment only by ID.

ModifiedRecord.java


import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;
import java.util.UUID;

/**
 *Record for master update.
 * <pre>
 *This VO implements equivalence for classifying master updates.
 *The equals method is used to determine equivalence{@code primaryKey}Does not include.
 * </pre>
 */
@Data
@EqualsAndHashCode
@NoArgsConstructor
@ToString
public class ModifiedRecord {

    @EqualsAndHashCode.Exclude
    private UUID primaryKey;
    private Integer age;
    private String name;

    public ModifiedRecord(Record record) {
        try {
            BeanUtils.copyProperties(this, record);
        } catch (IllegalAccessException | InvocationTargetException e) {
            e.printStackTrace();
        }
    }
}

Record class that performs equivalence judgment in fields other than ID (name, age).

RecordPatternSample.java



import org.apache.commons.lang3.RandomUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.*;
import java.util.stream.Collectors;

/**
 *Record set operation sample
 */
public class RecordPatternSample {
    private Logger logger = LoggerFactory.getLogger(RecordPatternSample.class);

    enum ModifiedPattern {
        NEW,
        UPDATE,
        DELETE,
        NO_MODIFIED
    }

    //I want to sort and output, so enable Comparable implemented in Record with TreeSet
    //Master record group
    private SortedSet<Record> masterRecords = new TreeSet<>();
    //Request record group (master record update data sent by some method)
    private SortedSet<Record> requestRecords = new TreeSet<>();

    public RecordPatternSample() {
        int totalSize = 100;
        while (masterRecords.size() < totalSize) {
            masterRecords.add(createRandomRecord());
        }

        int createSize = masterRecords.size();

        //Half the number of existing data in the request data
        int existsDataCount = createSize / 2;
        List<Record> createdList = masterRecords.stream().collect(Collectors.toList());
        while(requestRecords.size() < existsDataCount) {
            Record requestData = createRandomRecord();
            requestData.setPrimaryKey(createdList.get(requestRecords.size()).getPrimaryKey());
            requestRecords.add(requestData);
        }
        //The other half will be new data (must be new by UUID)
        while (requestRecords.size() < createSize) {
            requestRecords.add(createRandomRecord());
        }
    }

    public static void main(String[] args) {
        new RecordPatternSample().exec();
    }

    private void exec() {
        //Get the union for print
        //At this point, the equivalent objects (which are not of interest to this process because they are unupdated data) are combined into one by Set.
        Set<Record> aPlusBSet = getPlusSet(masterRecords, requestRecords);

        //Preliminary list output
        //Based on the union, the equivalent objects are extracted from the master record group and request record group and output.
        logger.info("print Master , Request.");
        aPlusBSet.stream().forEach(e -> {
            Optional<Record> masterRecord = searchSameRecord(masterRecords, e);
            Optional<Record> requestRecord = searchSameRecord(requestRecords, e);

            ModifiedPattern modifiedPattern = getModifiedPattern(masterRecord, requestRecord);

            logger.info("{}\t master:{},\t request:{}",
                    modifiedPattern,
                    toString(masterRecord),
                    toString(requestRecord));
        });

        //Identify new, deleted, updated, and non-updated data by set calculation

        //Get a set that exists only in the request record group.
        //Request record group-Master record group = Data that exists only in the request record group
        //That is, new data
        Set<Record> newRecordSet = getSubtractSet(requestRecords, masterRecords);

        logger.info("Display new data.");
        newRecordSet.forEach(e -> logger.info("new :{}", toString(Optional.of(e))));

        //Get a set that exists only in the master record group.
        //Master record group-Request record group = Data that exists only in the master record group
        //That is, deleted data
        Set<Record> deleteRecordSet = getSubtractSet(masterRecords, requestRecords);
        logger.info("View deleted data.");
        deleteRecordSet.forEach(e -> logger.info("delete :{}", toString(Optional.of(e))));

        //Get the intersection of master records and request records.
        //Master record group (ID) x Request record group (ID) = ID group existing in both
        //Master record group (extracted by ID) x Request record group (extracted by ID) = Data group with the same ID on both sides
        //That is, the update data
        Set<Record> updateRecordSet = getUpdateSet(masterRecords, requestRecords);
        logger.info("Display of updated data.");
        updateRecordSet.forEach(e -> logger.info("update :{}", toString(Optional.of(e))));

        //It exists in both the master record group and the request record group, and all match exactly.
        Set<Record> noModifiedSet = getSameSet(masterRecords, requestRecords);
        logger.info("Display of data without update.");
        noModifiedSet.forEach(e -> logger.info("no modified :{}", toString(Optional.of(e))));
    }

    /**
     *Get the master update pattern
     *
     * @param masterRecord Master record
     * @param requestRecord request record
     * @return master update pattern
     */
    private ModifiedPattern getModifiedPattern(Optional<Record> masterRecord, Optional<Record> requestRecord) {

        if (masterRecord.isPresent() && requestRecord.isPresent()) {

            //By replacing it with ModifiedRecord
            //Verify equivalence excluding PK and confirm the presence or absence of update
            ModifiedRecord masterModifiedRecord = new ModifiedRecord(masterRecord.get());
            ModifiedRecord requestModifiedRecord = new ModifiedRecord(requestRecord.get());

            if (masterModifiedRecord.equals(requestModifiedRecord)) {
                return ModifiedPattern.NO_MODIFIED;
            }

            return ModifiedPattern.UPDATE;
        }

        if (!masterRecord.isPresent()) {
            return ModifiedPattern.NEW;
        }

        if (!requestRecord.isPresent()) {
            return ModifiedPattern.DELETE;
        }

        throw new IllegalStateException();
    }

    /**
     *Find the record of the same Primary Key from Set
     *
     * @param set set
     * @param e record
     * @return Optional record
     */
    private Optional<Record> searchSameRecord(Set<Record> set, Record e) {
        return set.stream().filter(t -> t.getPrimaryKey().equals(e.getPrimaryKey())).findFirst();
    }

    /**
     *Get the UUID, age and name strings.
     *
     * @param e record
     * @return UUID, age and name in colons
     */
    private String toString(Optional<Record> e) {
        if (!e.isPresent())
            return "nothing data";
        return e.map(e2 -> String.join(",", e2.getPrimaryKey().toString(), String.valueOf(e2.getAge()), e2.getName())).get();
    }

    /**
     *Get the intersection
     *
     * @param setA set A
     * @param setB set B
     * @return intersection set
     */
    private Set<Record> getUpdateSet(final Set<Record> setA, final Set<Record> setB) {
        SortedSet<Record> recordSetCopyA = new TreeSet<>(setA);
        SortedSet<Record> recordSetCopyB = new TreeSet<>(setB);

        //Get the Primary Key of the intersection
        //Extract IDs that exist in both set A and set B
        Set<UUID> samePrimarySet = recordSetCopyA.stream()
                .filter(e -> recordSetCopyB.stream().anyMatch(b -> e.getPrimaryKey().equals(b.getPrimaryKey())))
                .map(Record::getPrimaryKey)
                .collect(Collectors.toSet());

        //From the set A, the records that match the IDs of the elements of the set B are extracted.
        Set<Record> filteredSetA = recordSetCopyA.stream()
                .filter(e -> samePrimarySet.contains(e.getPrimaryKey()))
                .collect(Collectors.toSet());
        Set<Record> filteredSetB = recordSetCopyB.stream()
                .filter(e-> samePrimarySet.contains(e.getPrimaryKey()))
                .collect(Collectors.toSet());

        //Set A-Set B
        filteredSetA.removeAll(filteredSetB);

        return filteredSetA;
    }

    /**
     *Get the union.
     *
     * @param setA set A
     * @param setB set B
     * @return The union of set A and set B
     */
    private Set<Record> getPlusSet(final SortedSet<Record> setA, final SortedSet<Record> setB) {
        SortedSet<Record> recordSetAcopy = new TreeSet<>(setA);
        SortedSet<Record> recordSetBcopy = new TreeSet<>(setB);

        recordSetAcopy.addAll(recordSetBcopy);

        return recordSetAcopy;
    }

    /**
     *Get the difference set.
     *
     * @param setA set A
     * @param setB set B
     * @return set A minus set B
     */
    private Set<Record> getSubtractSet(SortedSet<Record> setA, SortedSet<Record> setB) {
        //Make the equals spec depend only on Primary Key match
        Set<DeleteOrInsertRecord> copyASet = setA.stream().map(DeleteOrInsertRecord::new).collect(Collectors.toSet());
        Set<DeleteOrInsertRecord> copyBSet = setB.stream().map(DeleteOrInsertRecord::new).collect(Collectors.toSet());

        //Exclude those with matching IDs
        copyASet.removeAll(copyBSet);

        //Revert to original record
        Set<Record> aSetSubtractBSet = copyASet.stream().map(Record::new).collect(Collectors.toSet());

        return aSetSubtractBSet;
    }

    /**
     *Obtain an equivalence set in which all items match.
     *
     * @param setA A set
     * @param setB B set
     * @return Equivalent set in which all items in the A set and B set match
     */
    private Set<Record> getSameSet(SortedSet<Record> setA, SortedSet<Record> setB) {
        SortedSet<Record> recordSetAcopy = new TreeSet<>(setA);
        SortedSet<Record> recordSetBcopy = new TreeSet<>(setB);

        recordSetAcopy.retainAll(recordSetBcopy);

        return recordSetAcopy;
    }

    /**
     *Generate a record with a random value.
     * <ul>
     * <li>id:UUID</li>
     * <li>Age: 1 to 5</li>
     * <li>Name: ichiro, jiro, saburo, shiro, goro,Random one of rokuro</li>
     * </ul>
     *
     * @return Record with a random value
     */
    Record createRandomRecord() {
        Record record = new Record();
        record.setPrimaryKey(UUID.randomUUID());
        record.setAge(RandomUtils.nextInt(1, 5));

        String[] names = new String[]{"ichiro", "jiro", "saburo", "shiro", "goro", "rokuro"};
        List<String> nameList = Arrays.asList(names);
        record.setName(nameList.get(RandomUtils.nextInt(1, nameList.size())));
        return record;
    }
}

Compare the two records (master record group, request record group) and A class that divides cases into 4 patterns: new, deleted, updated, and no update.

Execution result

> 21:39:19.529 [main] INFO recordPattern.RecordPatternSample - print Master , Request. 21:39:19.714 [main] INFO recordPattern.RecordPatternSample - UPDATE master:893b4348-ebce-4c43-8a45-3250bd3fc726,1,goro, request:893b4348-ebce-4c43-8a45-3250bd3fc726,1,jiro 21:39:19.714 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:9ff04fba-c802-4337-8bdb-aeab77c86f65,1,goro 21:39:19.714 [main] INFO recordPattern.RecordPatternSample - UPDATE master:f475429b-10cc-49bb-9279-921e641f3952,1,goro, request:f475429b-10cc-49bb-9279-921e641f3952,3,goro 21:39:19.714 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:2471eb0a-40c4-4f7a-83ea-57bca0573726,1,goro 21:39:19.714 [main] INFO recordPattern.RecordPatternSample - UPDATE master:47d530b4-e88b-4bbe-a1db-0b3dc7e32773,2,jiro, request:47d530b4-e88b-4bbe-a1db-0b3dc7e32773,1,goro 21:39:19.714 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:54e63a4b-17ec-4421-ba5d-6ab84301f298,1,goro 21:39:19.714 [main] INFO recordPattern.RecordPatternSample - UPDATE master:893b4348-ebce-4c43-8a45-3250bd3fc726,1,goro, request:893b4348-ebce-4c43-8a45-3250bd3fc726,1,jiro 21:39:19.714 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:a01bcef7-31de-4e64-95bc-1a658910549a,1,jiro 21:39:19.714 [main] INFO recordPattern.RecordPatternSample - UPDATE master:bac23a4d-fbd9-4e01-974e-5b4133c1b595,1,rokuro, request:bac23a4d-fbd9-4e01-974e-5b4133c1b595,1,jiro 21:39:19.714 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:bdaf5968-2e33-48ac-81d2-365b5c5d7287,1,jiro 21:39:19.730 [main] INFO recordPattern.RecordPatternSample - NO_MODIFIED master:dada18a6-73e2-4eef-8c29-649fb24d8616,1,jiro, request:dada18a6-73e2-4eef-8c29-649fb24d8616,1,jiro 21:39:19.730 [main] INFO recordPattern.RecordPatternSample - UPDATE master:dca9c586-5f80-46f2-bcb8-f1d6aa7470a6,1,shiro, request:dca9c586-5f80-46f2-bcb8-f1d6aa7470a6,1,jiro 21:39:19.730 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:e00bdc64-39ca-4413-8ee5-4b6d8fa2d914,1,jiro 21:39:19.730 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:fcc587b0-b359-4f66-96df-9c89f5d73260,1,jiro 21:39:19.730 [main] INFO recordPattern.RecordPatternSample - UPDATE master:0c5c1e69-c58c-41f9-9a78-ef9bfc58e416,1,jiro, request:0c5c1e69-c58c-41f9-9a78-ef9bfc58e416,4,jiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:24a08049-ef2e-4c9f-b934-e2fa8853bbd5,1,jiro, request:24a08049-ef2e-4c9f-b934-e2fa8853bbd5,3,saburo 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:2d1f1380-0072-45cd-9452-024e137f9c1e,2,goro, request:2d1f1380-0072-45cd-9452-024e137f9c1e,1,jiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:3ce5b826-0822-4c37-bf77-51a4b7468fd6,1,jiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:4d4a5b75-da44-475c-bccd-f3acb77d5e48,1,jiro, request:4d4a5b75-da44-475c-bccd-f3acb77d5e48,2,shiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:7112029b-7e91-43ce-858e-b5cd1a15d127,1,shiro, request:7112029b-7e91-43ce-858e-b5cd1a15d127,1,jiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:838c0aef-873f-42df-b393-03a0babd7cfa,1,rokuro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:8df9c1a1-b6db-4bc0-b7dd-510cd7a3f3ce,1,rokuro, request:8df9c1a1-b6db-4bc0-b7dd-510cd7a3f3ce,4,shiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:b923f1ab-7324-4fbf-a13a-c16eadc4af7e,1,rokuro, request:b923f1ab-7324-4fbf-a13a-c16eadc4af7e,3,rokuro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:bac23a4d-fbd9-4e01-974e-5b4133c1b595,1,rokuro, request:bac23a4d-fbd9-4e01-974e-5b4133c1b595,1,jiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:c2941487-0185-46b0-8117-c4817bfe5147,1,saburo, request:c2941487-0185-46b0-8117-c4817bfe5147,1,rokuro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:e1754cc1-56c4-4e36-964d-1ab839bd2846,1,rokuro, request:e1754cc1-56c4-4e36-964d-1ab839bd2846,4,shiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:ebaeb8c4-949f-4731-b803-5836b340a875,1,rokuro, request:ebaeb8c4-949f-4731-b803-5836b340a875,2,shiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:291129c5-30ad-4a58-9861-364790f0a637,1,rokuro, request:291129c5-30ad-4a58-9861-364790f0a637,3,shiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:32ce3fe9-cf1d-4e60-b6e3-e54404063cb6,1,rokuro, request:32ce3fe9-cf1d-4e60-b6e3-e54404063cb6,2,shiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:57eab0b5-0cab-4982-9a99-15c1e54bb67d,2,shiro, request:57eab0b5-0cab-4982-9a99-15c1e54bb67d,1,rokuro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:8b37364d-e442-424b-b8df-e36e3fb30f2b,2,saburo, request:8b37364d-e442-424b-b8df-e36e3fb30f2b,1,saburo 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:a3273975-9147-4145-a600-dc111d2b3600,1,saburo 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:a59b47ca-0233-49f6-ac27-4748687ef0a6,1,saburo, request:a59b47ca-0233-49f6-ac27-4748687ef0a6,2,shiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:bc6193a2-1702-480f-93ac-78b12e9a93dc,1,saburo, request:bc6193a2-1702-480f-93ac-78b12e9a93dc,2,saburo 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:c2941487-0185-46b0-8117-c4817bfe5147,1,saburo, request:c2941487-0185-46b0-8117-c4817bfe5147,1,rokuro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:c8d1d9fe-7550-48cf-b568-110644075e19,1,saburo, request:c8d1d9fe-7550-48cf-b568-110644075e19,4,rokuro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:02686803-4b17-4c0a-914e-ab04ba84e560,1,saburo, request:02686803-4b17-4c0a-914e-ab04ba84e560,3,rokuro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:0dc33f79-6308-47a8-bd06-08ac6c8fc185,1,saburo 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:15f73130-7a5e-41cc-b43f-0910fbfe9429,2,goro, request:15f73130-7a5e-41cc-b43f-0910fbfe9429,1,saburo 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:1bd7b5e3-cf7b-47fb-b995-19877f05af44,1,saburo 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:25ce82f5-d45b-4779-98f1-d0c16fad6594,1,saburo, request:25ce82f5-d45b-4779-98f1-d0c16fad6594,2,goro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:74c8a2e7-dd4f-4cfb-838f-32e62f799c2e,1,saburo, request:74c8a2e7-dd4f-4cfb-838f-32e62f799c2e,4,saburo 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:7bc84c8f-9c5b-4342-805d-ad286cf7941a,1,saburo 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:83245858-ff8f-4426-8462-c791e44e0f3c,2,shiro, request:83245858-ff8f-4426-8462-c791e44e0f3c,1,shiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:888744f4-0f49-4f01-8506-ab063ce2f778,1,shiro, request:888744f4-0f49-4f01-8506-ab063ce2f778,2,goro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:a31e9986-5bfe-44de-977d-33ca4c3848ef,1,shiro, request:a31e9986-5bfe-44de-977d-33ca4c3848ef,3,jiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:b74d351a-f038-4f7c-b718-3705dc71e07d,2,goro, request:b74d351a-f038-4f7c-b718-3705dc71e07d,1,shiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:c97bf082-d689-43e9-bee5-f1c28274d138,2,goro, request:c97bf082-d689-43e9-bee5-f1c28274d138,1,shiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:dc04d992-baf5-42ea-8d68-3e7bb7beda3f,1,shiro 21:39:19.745 [main] INFO recordPattern.RecordPatternSample - UPDATE master:dca9c586-5f80-46f2-bcb8-f1d6aa7470a6,1,shiro, request:dca9c586-5f80-46f2-bcb8-f1d6aa7470a6,1,jiro 21:39:19.761 [main] INFO recordPattern.RecordPatternSample - UPDATE master:dfe53792-5b82-4338-8e4e-510e1e5099ef,3,goro, request:dfe53792-5b82-4338-8e4e-510e1e5099ef,1,shiro 21:39:19.761 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:003ab2ed-be1d-4387-8e09-80f85bd54352,1,shiro 21:39:19.761 [main] INFO recordPattern.RecordPatternSample - UPDATE master:05a10afa-ffa8-4d23-b686-14d4325c3917,1,shiro, request:05a10afa-ffa8-4d23-b686-14d4325c3917,2,rokuro 21:39:19.761 [main] INFO recordPattern.RecordPatternSample - UPDATE master:0cc04ce6-5698-4b38-9f3b-1d429c4f57e7,2,jiro, request:0cc04ce6-5698-4b38-9f3b-1d429c4f57e7,1,shiro 21:39:19.761 [main] INFO recordPattern.RecordPatternSample - UPDATE master:168d5fe9-e369-4d3d-956b-e9faa6c91a25,1,shiro, request:168d5fe9-e369-4d3d-956b-e9faa6c91a25,2,goro 21:39:19.761 [main] INFO recordPattern.RecordPatternSample - UPDATE master:30752912-5d69-42a8-8892-907972b2430e,1,shiro, request:30752912-5d69-42a8-8892-907972b2430e,4,saburo 21:39:19.761 [main] INFO recordPattern.RecordPatternSample - UPDATE master:3a67008e-7fa2-496b-b50c-341eb7e4fb18,1,shiro, request:3a67008e-7fa2-496b-b50c-341eb7e4fb18,2,shiro 21:39:19.761 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:4bbaef48-a19c-4315-ba80-77437a7cc7ec,1,shiro 21:39:19.761 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:596aad9c-6fdd-4332-b36e-70573b2533fa,1,shiro 21:39:19.761 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:65bf8b3d-bcb8-45d1-b8eb-8ea6ad3f5a91,1,shiro 21:39:19.761 [main] INFO recordPattern.RecordPatternSample - UPDATE master:6bd5f5f2-154a-435f-a43d-49d013023a10,2,shiro, request:6bd5f5f2-154a-435f-a43d-49d013023a10,1,shiro 21:39:19.761 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:6fe7ae99-e991-4846-8e39-67c733d667d8,1,shiro 21:39:19.761 [main] INFO recordPattern.RecordPatternSample - UPDATE master:7112029b-7e91-43ce-858e-b5cd1a15d127,1,shiro, request:7112029b-7e91-43ce-858e-b5cd1a15d127,1,jiro 21:39:19.761 [main] INFO recordPattern.RecordPatternSample - UPDATE master:888744f4-0f49-4f01-8506-ab063ce2f778,1,shiro, request:888744f4-0f49-4f01-8506-ab063ce2f778,2,goro 21:39:19.761 [main] INFO recordPattern.RecordPatternSample - UPDATE master:b74d351a-f038-4f7c-b718-3705dc71e07d,2,goro, request:b74d351a-f038-4f7c-b718-3705dc71e07d,1,shiro 21:39:19.767 [main] INFO recordPattern.RecordPatternSample - UPDATE master:c97bf082-d689-43e9-bee5-f1c28274d138,2,goro, request:c97bf082-d689-43e9-bee5-f1c28274d138,1,shiro 21:39:19.769 [main] INFO recordPattern.RecordPatternSample - UPDATE master:d0c4e7af-dde1-4c94-a047-600721215303,2,goro, request:d0c4e7af-dde1-4c94-a047-600721215303,2,rokuro 21:39:19.769 [main] INFO recordPattern.RecordPatternSample - UPDATE master:e4e92eb9-0c4f-483b-91ac-ef2132da6294,2,jiro, request:e4e92eb9-0c4f-483b-91ac-ef2132da6294,2,goro 21:39:19.769 [main] INFO recordPattern.RecordPatternSample - UPDATE master:15f73130-7a5e-41cc-b43f-0910fbfe9429,2,goro, request:15f73130-7a5e-41cc-b43f-0910fbfe9429,1,saburo 21:39:19.769 [main] INFO recordPattern.RecordPatternSample - UPDATE master:168d5fe9-e369-4d3d-956b-e9faa6c91a25,1,shiro, request:168d5fe9-e369-4d3d-956b-e9faa6c91a25,2,goro 21:39:19.769 [main] INFO recordPattern.RecordPatternSample - UPDATE master:25ce82f5-d45b-4779-98f1-d0c16fad6594,1,saburo, request:25ce82f5-d45b-4779-98f1-d0c16fad6594,2,goro 21:39:19.769 [main] INFO recordPattern.RecordPatternSample - UPDATE master:2d1f1380-0072-45cd-9452-024e137f9c1e,2,goro, request:2d1f1380-0072-45cd-9452-024e137f9c1e,1,jiro 21:39:19.769 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:59a19a25-bc2a-446f-9f0a-ac11a02936ee,2,goro 21:39:19.769 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:629d6a24-9108-409f-b6bd-d1e72f0f8205,2,goro 21:39:19.769 [main] INFO recordPattern.RecordPatternSample - UPDATE master:74ed8852-6d6a-40e0-8923-a71023f72e6c,2,goro, request:74ed8852-6d6a-40e0-8923-a71023f72e6c,2,shiro 21:39:19.769 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:90a23d6d-7f76-4a01-b317-b5fccc10d8a0,2,jiro 21:39:19.769 [main] INFO recordPattern.RecordPatternSample - UPDATE master:9cbd1993-bf0f-48b6-89e7-78fd0bb7c94c,2,jiro, request:9cbd1993-bf0f-48b6-89e7-78fd0bb7c94c,3,shiro 21:39:19.769 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:aa74296f-073b-488d-99be-3471695d9632,2,jiro 21:39:19.769 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:b8478d6c-d8fc-4d2d-a7cd-26f9575d3795,2,jiro 21:39:19.769 [main] INFO recordPattern.RecordPatternSample - UPDATE master:e4e92eb9-0c4f-483b-91ac-ef2132da6294,2,jiro, request:e4e92eb9-0c4f-483b-91ac-ef2132da6294,2,goro 21:39:19.769 [main] INFO recordPattern.RecordPatternSample - UPDATE master:0cc04ce6-5698-4b38-9f3b-1d429c4f57e7,2,jiro, request:0cc04ce6-5698-4b38-9f3b-1d429c4f57e7,1,shiro 21:39:19.777 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:1e5aad3a-a688-48e1-b777-fb09561c0876,2,jiro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:47d530b4-e88b-4bbe-a1db-0b3dc7e32773,2,jiro, request:47d530b4-e88b-4bbe-a1db-0b3dc7e32773,1,goro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:9e73f7d1-de2a-4ad0-9b16-a225001c1a5d,2,rokuro, request:9e73f7d1-de2a-4ad0-9b16-a225001c1a5d,2,shiro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:d0c4e7af-dde1-4c94-a047-600721215303,2,goro, request:d0c4e7af-dde1-4c94-a047-600721215303,2,rokuro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:f8625d47-4183-4693-a4b4-048abe92e190,2,rokuro, request:f8625d47-4183-4693-a4b4-048abe92e190,2,shiro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:05a10afa-ffa8-4d23-b686-14d4325c3917,1,shiro, request:05a10afa-ffa8-4d23-b686-14d4325c3917,2,rokuro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:0ece9e7f-ed59-49cf-b5d0-20baf8deab78,2,rokuro, request:0ece9e7f-ed59-49cf-b5d0-20baf8deab78,3,goro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:2eb116e0-afe4-4c30-a562-82c28b33e0ca,2,saburo, request:2eb116e0-afe4-4c30-a562-82c28b33e0ca,2,rokuro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:6fcef8cf-a3c3-4581-8218-71feaa86eadf,2,rokuro, request:6fcef8cf-a3c3-4581-8218-71feaa86eadf,4,jiro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:8b37364d-e442-424b-b8df-e36e3fb30f2b,2,saburo, request:8b37364d-e442-424b-b8df-e36e3fb30f2b,1,saburo 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:a95c1a23-1720-45ae-8ab1-a50029c4cd49,2,saburo 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:bc6193a2-1702-480f-93ac-78b12e9a93dc,1,saburo, request:bc6193a2-1702-480f-93ac-78b12e9a93dc,2,saburo 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:2eb116e0-afe4-4c30-a562-82c28b33e0ca,2,saburo, request:2eb116e0-afe4-4c30-a562-82c28b33e0ca,2,rokuro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:83245858-ff8f-4426-8462-c791e44e0f3c,2,shiro, request:83245858-ff8f-4426-8462-c791e44e0f3c,1,shiro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:9e73f7d1-de2a-4ad0-9b16-a225001c1a5d,2,rokuro, request:9e73f7d1-de2a-4ad0-9b16-a225001c1a5d,2,shiro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:a59b47ca-0233-49f6-ac27-4748687ef0a6,1,saburo, request:a59b47ca-0233-49f6-ac27-4748687ef0a6,2,shiro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:bd6151b8-70f2-40f2-b6e2-8c25a861ca99,2,shiro, request:bd6151b8-70f2-40f2-b6e2-8c25a861ca99,4,shiro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:d8207ec8-8a19-44de-a156-0e68c33e2a35,2,shiro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:e1ec3242-3de6-4e85-873f-a1c0ea7abfe5,2,shiro 21:39:19.779 [main] INFO recordPattern.RecordPatternSample - UPDATE master:ebaeb8c4-949f-4731-b803-5836b340a875,1,rokuro, request:ebaeb8c4-949f-4731-b803-5836b340a875,2,shiro 21:39:19.787 [main] INFO recordPattern.RecordPatternSample - UPDATE master:f8625d47-4183-4693-a4b4-048abe92e190,2,rokuro, request:f8625d47-4183-4693-a4b4-048abe92e190,2,shiro 21:39:19.787 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:317663cd-2348-416d-b0d5-99aa379dffc9,2,shiro 21:39:19.787 [main] INFO recordPattern.RecordPatternSample - UPDATE master:32ce3fe9-cf1d-4e60-b6e3-e54404063cb6,1,rokuro, request:32ce3fe9-cf1d-4e60-b6e3-e54404063cb6,2,shiro 21:39:19.787 [main] INFO recordPattern.RecordPatternSample - UPDATE master:3a67008e-7fa2-496b-b50c-341eb7e4fb18,1,shiro, request:3a67008e-7fa2-496b-b50c-341eb7e4fb18,2,shiro 21:39:19.787 [main] INFO recordPattern.RecordPatternSample - NO_MODIFIED master:3dd86959-d1c6-4e91-bdc8-be20e4ac7cdc,2,shiro, request:3dd86959-d1c6-4e91-bdc8-be20e4ac7cdc,2,shiro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - UPDATE master:4d4a5b75-da44-475c-bccd-f3acb77d5e48,1,jiro, request:4d4a5b75-da44-475c-bccd-f3acb77d5e48,2,shiro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - UPDATE master:57eab0b5-0cab-4982-9a99-15c1e54bb67d,2,shiro, request:57eab0b5-0cab-4982-9a99-15c1e54bb67d,1,rokuro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - UPDATE master:6bd5f5f2-154a-435f-a43d-49d013023a10,2,shiro, request:6bd5f5f2-154a-435f-a43d-49d013023a10,1,shiro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - UPDATE master:74ed8852-6d6a-40e0-8923-a71023f72e6c,2,goro, request:74ed8852-6d6a-40e0-8923-a71023f72e6c,2,shiro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - UPDATE master:dfe53792-5b82-4338-8e4e-510e1e5099ef,3,goro, request:dfe53792-5b82-4338-8e4e-510e1e5099ef,1,shiro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - UPDATE master:f475429b-10cc-49bb-9279-921e641f3952,1,goro, request:f475429b-10cc-49bb-9279-921e641f3952,3,goro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - UPDATE master:0ece9e7f-ed59-49cf-b5d0-20baf8deab78,2,rokuro, request:0ece9e7f-ed59-49cf-b5d0-20baf8deab78,3,goro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:10273738-2d41-4584-93f8-4554d5cdd015,3,goro, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:116120a9-10f4-4e6e-bcec-45dd382d2ede,3,goro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:5f28cf17-a204-4935-8b1b-429eee8eb327,3,goro, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:620fee15-0f18-4d13-9cd9-5adf8cae2a41,3,goro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:64b846e5-9a4b-4b47-a2a6-601189a3bbbc,3,goro, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:81c4700d-6030-4569-aa83-6a1312d3032e,3,jiro, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:823ead11-9213-40a4-8699-7cdd21a67825,3,jiro, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - UPDATE master:a31e9986-5bfe-44de-977d-33ca4c3848ef,1,shiro, request:a31e9986-5bfe-44de-977d-33ca4c3848ef,3,jiro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:a385fb96-0cc4-4eb9-a0bd-8b99c3733f3f,3,jiro, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:cb7ad23a-4e86-46c7-8bd8-c1d9002cd01f,3,jiro, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:ce762caf-eef8-4d07-805e-a8dad4755be6,3,jiro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:6958f6a4-ad80-40eb-b80a-554e1e76e516,3,jiro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:9149e643-7a0b-4aea-bbe3-9f32474747d2,3,rokuro, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:a5f685e5-8cfa-4b42-a3f3-4beed0495a6d,3,rokuro, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:a62e2530-8892-49fe-a2b7-90dcfe6a1a94,3,rokuro, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - UPDATE master:b923f1ab-7324-4fbf-a13a-c16eadc4af7e,1,rokuro, request:b923f1ab-7324-4fbf-a13a-c16eadc4af7e,3,rokuro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - UPDATE master:02686803-4b17-4c0a-914e-ab04ba84e560,1,saburo, request:02686803-4b17-4c0a-914e-ab04ba84e560,3,rokuro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:039f10e0-2325-4453-9b85-592cfb4dfacf,3,rokuro, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:27a9c03c-7c3e-4bca-a7cf-5205b9ed064b,3,rokuro, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:476e5888-2812-48e6-b74b-9f144fb08af3,3,rokuro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:60a5f406-9df8-4d4b-98cb-2e42480aa757,3,rokuro, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:68d10177-abd7-4d20-a422-bf2073924448,3,rokuro 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:6b8a6a5f-fdbb-4e80-8d00-b81ecce590a3,3,rokuro, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:6cd08a93-5cad-4ba5-acc5-1a027ba67a6b,3,rokuro, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:8c6a8e46-b65c-4209-b84a-5bd75f26d74b,3,saburo, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:abf89771-659a-4a26-927c-ac085851806e,3,saburo, request:nothing data 21:39:19.790 [main] INFO recordPattern.RecordPatternSample - DELETE master:ac67cc40-ec81-4553-baa9-04ba9ecbf516,3,saburo, request:nothing data 21:39:19.798 [main] INFO recordPattern.RecordPatternSample - DELETE master:b5997fc1-3009-48ca-a8d9-33656f59b8bc,3,saburo, request:nothing data 21:39:19.798 [main] INFO recordPattern.RecordPatternSample - DELETE master:bc2bd2e8-9f11-49c8-ac2e-1bf2de099ce2,3,saburo, request:nothing data 21:39:19.798 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:bd4fec8e-ccc0-4e71-9cab-ee10cc859d80,3,saburo 21:39:19.798 [main] INFO recordPattern.RecordPatternSample - DELETE master:cd13459f-f74d-430f-994f-47755c6a61fc,3,saburo, request:nothing data 21:39:19.798 [main] INFO recordPattern.RecordPatternSample - DELETE master:cf6e53cb-2f85-4ceb-b229-f4f5ac685914,3,saburo, request:nothing data 21:39:19.798 [main] INFO recordPattern.RecordPatternSample - DELETE master:e2c9bea6-bce5-498f-9a7c-90e15fad5b24,3,saburo, request:nothing data 21:39:19.798 [main] INFO recordPattern.RecordPatternSample - UPDATE master:24a08049-ef2e-4c9f-b934-e2fa8853bbd5,1,jiro, request:24a08049-ef2e-4c9f-b934-e2fa8853bbd5,3,saburo 21:39:19.798 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:72dc67f6-1fc4-4e5f-ba48-54ad5ffbe80e,3,saburo 21:39:19.798 [main] INFO recordPattern.RecordPatternSample - DELETE master:95d8fcf0-856f-4376-abda-9d1a0f518e52,3,shiro, request:nothing data 21:39:19.798 [main] INFO recordPattern.RecordPatternSample - UPDATE master:9cbd1993-bf0f-48b6-89e7-78fd0bb7c94c,2,jiro, request:9cbd1993-bf0f-48b6-89e7-78fd0bb7c94c,3,shiro 21:39:19.800 [main] INFO recordPattern.RecordPatternSample - DELETE master:bd67860c-eb96-41e9-92bf-dc3042bcc163,3,shiro, request:nothing data 21:39:19.800 [main] INFO recordPattern.RecordPatternSample - DELETE master:ccf4e3c0-6eea-46f7-8b5b-dea70315f1fe,3,shiro, request:nothing data 21:39:19.800 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:e18557e4-8b84-4cc3-bae8-a0bc60235c56,3,shiro 21:39:19.800 [main] INFO recordPattern.RecordPatternSample - DELETE master:26569d30-fb2f-470e-b3a9-d47d3e02b621,3,shiro, request:nothing data 21:39:19.800 [main] INFO recordPattern.RecordPatternSample - UPDATE master:291129c5-30ad-4a58-9861-364790f0a637,1,rokuro, request:291129c5-30ad-4a58-9861-364790f0a637,3,shiro 21:39:19.800 [main] INFO recordPattern.RecordPatternSample - DELETE master:63631afd-433e-4620-a401-f423c852bcfb,3,shiro, request:nothing data 21:39:19.800 [main] INFO recordPattern.RecordPatternSample - DELETE master:6f44b1f9-d29f-4c07-bdc7-9554dc14ee97,3,shiro, request:nothing data 21:39:19.800 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:7c296fbf-9b80-4f52-b298-2354d0a60a98,3,shiro 21:39:19.800 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:80fd1211-f1d8-4498-ab65-c12682cac4d4,4,goro 21:39:19.800 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:8d717a19-6e65-46f3-ab8e-a02be65b40cc,4,goro 21:39:19.800 [main] INFO recordPattern.RecordPatternSample - DELETE master:10dbfb93-c762-4557-83a4-b4e8fce3b57a,4,goro, request:nothing data 21:39:19.800 [main] INFO recordPattern.RecordPatternSample - DELETE master:3ac1d4ac-9ef2-454b-a0b5-7b70f0a37bd7,4,goro, request:nothing data 21:39:19.800 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:b347ad72-4951-428c-a417-9e8ec3be7bd3,4,jiro 21:39:19.808 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:c2bc4e1c-ac98-489c-8522-4fcf49f95965,4,jiro 21:39:19.808 [main] INFO recordPattern.RecordPatternSample - DELETE master:d8e0bb66-f99f-41a6-a726-2cc6026966ea,4,jiro, request:nothing data 21:39:19.808 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:e91e2c80-16da-43c2-8786-3c636ab52fd9,4,jiro 21:39:19.808 [main] INFO recordPattern.RecordPatternSample - DELETE master:f551e46b-ad4c-475d-b68f-b55b1b699a82,4,jiro, request:nothing data 21:39:19.808 [main] INFO recordPattern.RecordPatternSample - UPDATE master:0c5c1e69-c58c-41f9-9a78-ef9bfc58e416,1,jiro, request:0c5c1e69-c58c-41f9-9a78-ef9bfc58e416,4,jiro 21:39:19.808 [main] INFO recordPattern.RecordPatternSample - UPDATE master:6fcef8cf-a3c3-4581-8218-71feaa86eadf,2,rokuro, request:6fcef8cf-a3c3-4581-8218-71feaa86eadf,4,jiro 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - DELETE master:766966b8-c212-4336-ba34-e392754ddc1a,4,jiro, request:nothing data 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - DELETE master:7724e31f-268b-4aac-b755-61f048483a13,4,jiro, request:nothing data 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - DELETE master:972c8872-8328-489f-b842-de590834f907,4,rokuro, request:nothing data 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - DELETE master:a284f196-84a4-4f2f-9828-3e0158857c75,4,rokuro, request:nothing data 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:c219c4a3-bd78-4c1d-84ca-26b87e0b3723,4,rokuro 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - UPDATE master:c8d1d9fe-7550-48cf-b568-110644075e19,1,saburo, request:c8d1d9fe-7550-48cf-b568-110644075e19,4,rokuro 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:124f781b-b2c5-4b41-b9d7-1e450187dc36,4,rokuro 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:4a21ce3f-b0a9-4c74-8cf4-c6b084067440,4,rokuro 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - DELETE master:5d14ab31-84ec-47c7-8bee-6a8f6afa3f59,4,rokuro, request:nothing data 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - DELETE master:6a231e9e-7e1c-41bd-8578-bfc8aeb74828,4,rokuro, request:nothing data 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - DELETE master:9b962555-d358-4472-9bca-ec304e7358a9,4,saburo, request:nothing data 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - DELETE master:e5063475-63d3-4aac-ab4c-228ee626717a,4,saburo, request:nothing data 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:1afaeffc-88c4-4b13-829d-7e2b576fe89f,4,saburo 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - UPDATE master:30752912-5d69-42a8-8892-907972b2430e,1,shiro, request:30752912-5d69-42a8-8892-907972b2430e,4,saburo 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:5f2b0b16-1384-4fa8-b4df-81796e3424d7,4,saburo 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - UPDATE master:74c8a2e7-dd4f-4cfb-838f-32e62f799c2e,1,saburo, request:74c8a2e7-dd4f-4cfb-838f-32e62f799c2e,4,saburo 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - UPDATE master:8df9c1a1-b6db-4bc0-b7dd-510cd7a3f3ce,1,rokuro, request:8df9c1a1-b6db-4bc0-b7dd-510cd7a3f3ce,4,shiro 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - DELETE master:a8a64c80-1421-4227-8048-e5d1d3060b26,4,shiro, request:nothing data 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - DELETE master:b4611046-a331-477c-8379-c3de6f225c6e,4,shiro, request:nothing data 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - NEW master:nothing data, request:b8e7dc78-06ac-429a-83f6-d8ea99269b74,4,shiro 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - UPDATE master:bd6151b8-70f2-40f2-b6e2-8c25a861ca99,2,shiro, request:bd6151b8-70f2-40f2-b6e2-8c25a861ca99,4,shiro 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - DELETE master:cc758d94-b5c8-415c-94e9-29647e498995,4,shiro, request:nothing data 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - UPDATE master:e1754cc1-56c4-4e36-964d-1ab839bd2846,1,rokuro, request:e1754cc1-56c4-4e36-964d-1ab839bd2846,4,shiro 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - DELETE master:ea5c2f0f-05e4-42ea-8088-8a86961ddc64,4,shiro, request:nothing data 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - DELETE master:05cc34a7-9673-4da7-b4a7-1a504a94a6fb,4,shiro, request:nothing data 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - DELETE master:181a298d-96e1-4a21-aad0-7caa2cadaaa9,4,shiro, request:nothing data 21:39:19.810 [main] INFO recordPattern.RecordPatternSample - DELETE master:6a85ae1b-2d78-4397-b46b-8d7ab4652711,4,shiro, request:nothing data 21:39:19.818 [main] INFO recordPattern.RecordPatternSample - DELETE master:78e8adb9-774f-40ec-8db9-35d87fe2c692,4,shiro, request:nothing data 21:39:19.818 [main] INFO recordPattern.RecordPatternSample - DELETE master:7d98d23c-7ec1-4c0c-999c-4abdb9d8f52e,4,shiro, request:nothing data 21: 39: 19.860 [main] INFO recordPattern.RecordPatternSample --Display new data. 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :3ce5b826-0822-4c37-bf77-51a4b7468fd6,1,jiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :4a21ce3f-b0a9-4c74-8cf4-c6b084067440,4,rokuro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :a3273975-9147-4145-a600-dc111d2b3600,1,saburo 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :596aad9c-6fdd-4332-b36e-70573b2533fa,1,shiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :c2bc4e1c-ac98-489c-8522-4fcf49f95965,4,jiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :6958f6a4-ad80-40eb-b80a-554e1e76e516,3,jiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :629d6a24-9108-409f-b6bd-d1e72f0f8205,2,goro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :a01bcef7-31de-4e64-95bc-1a658910549a,1,jiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :e18557e4-8b84-4cc3-bae8-a0bc60235c56,3,shiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :c219c4a3-bd78-4c1d-84ca-26b87e0b3723,4,rokuro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :8d717a19-6e65-46f3-ab8e-a02be65b40cc,4,goro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :317663cd-2348-416d-b0d5-99aa379dffc9,2,shiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :bdaf5968-2e33-48ac-81d2-365b5c5d7287,1,jiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :5f2b0b16-1384-4fa8-b4df-81796e3424d7,4,saburo 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :90a23d6d-7f76-4a01-b317-b5fccc10d8a0,2,jiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :b8478d6c-d8fc-4d2d-a7cd-26f9575d3795,2,jiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :b347ad72-4951-428c-a417-9e8ec3be7bd3,4,jiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :bd4fec8e-ccc0-4e71-9cab-ee10cc859d80,3,saburo 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :476e5888-2812-48e6-b74b-9f144fb08af3,3,rokuro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :7bc84c8f-9c5b-4342-805d-ad286cf7941a,1,saburo 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :116120a9-10f4-4e6e-bcec-45dd382d2ede,3,goro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :b8e7dc78-06ac-429a-83f6-d8ea99269b74,4,shiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :59a19a25-bc2a-446f-9f0a-ac11a02936ee,2,goro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :9ff04fba-c802-4337-8bdb-aeab77c86f65,1,goro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :2471eb0a-40c4-4f7a-83ea-57bca0573726,1,goro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :80fd1211-f1d8-4498-ab65-c12682cac4d4,4,goro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :1bd7b5e3-cf7b-47fb-b995-19877f05af44,1,saburo 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :54e63a4b-17ec-4421-ba5d-6ab84301f298,1,goro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :0dc33f79-6308-47a8-bd06-08ac6c8fc185,1,saburo 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :e1ec3242-3de6-4e85-873f-a1c0ea7abfe5,2,shiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :1e5aad3a-a688-48e1-b777-fb09561c0876,2,jiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :72dc67f6-1fc4-4e5f-ba48-54ad5ffbe80e,3,saburo 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :fcc587b0-b359-4f66-96df-9c89f5d73260,1,jiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :a95c1a23-1720-45ae-8ab1-a50029c4cd49,2,saburo 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :1afaeffc-88c4-4b13-829d-7e2b576fe89f,4,saburo 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :4bbaef48-a19c-4315-ba80-77437a7cc7ec,1,shiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :620fee15-0f18-4d13-9cd9-5adf8cae2a41,3,goro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :d8207ec8-8a19-44de-a156-0e68c33e2a35,2,shiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :ce762caf-eef8-4d07-805e-a8dad4755be6,3,jiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :68d10177-abd7-4d20-a422-bf2073924448,3,rokuro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :e00bdc64-39ca-4413-8ee5-4b6d8fa2d914,1,jiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :e91e2c80-16da-43c2-8786-3c636ab52fd9,4,jiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :838c0aef-873f-42df-b393-03a0babd7cfa,1,rokuro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :7c296fbf-9b80-4f52-b298-2354d0a60a98,3,shiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :003ab2ed-be1d-4387-8e09-80f85bd54352,1,shiro 21:39:19.860 [main] INFO recordPattern.RecordPatternSample - new :6fe7ae99-e991-4846-8e39-67c733d667d8,1,shiro 21:39:19.868 [main] INFO recordPattern.RecordPatternSample - new :124f781b-b2c5-4b41-b9d7-1e450187dc36,4,rokuro 21:39:19.868 [main] INFO recordPattern.RecordPatternSample - new :65bf8b3d-bcb8-45d1-b8eb-8ea6ad3f5a91,1,shiro 21:39:19.868 [main] INFO recordPattern.RecordPatternSample - new :aa74296f-073b-488d-99be-3471695d9632,2,jiro 21:39:19.868 [main] INFO recordPattern.RecordPatternSample - new :dc04d992-baf5-42ea-8d68-3e7bb7beda3f,1,shiro 21: 39: 19.880 [main] INFO recordPattern.RecordPatternSample-Display deleted data. 21:39:19.880 [main] INFO recordPattern.RecordPatternSample - delete :5d14ab31-84ec-47c7-8bee-6a8f6afa3f59,4,rokuro 21:39:19.880 [main] INFO recordPattern.RecordPatternSample - delete :f551e46b-ad4c-475d-b68f-b55b1b699a82,4,jiro 21:39:19.880 [main] INFO recordPattern.RecordPatternSample - delete :3ac1d4ac-9ef2-454b-a0b5-7b70f0a37bd7,4,goro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :cb7ad23a-4e86-46c7-8bd8-c1d9002cd01f,3,jiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :60a5f406-9df8-4d4b-98cb-2e42480aa757,3,rokuro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :6cd08a93-5cad-4ba5-acc5-1a027ba67a6b,3,rokuro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :bd67860c-eb96-41e9-92bf-dc3042bcc163,3,shiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :6b8a6a5f-fdbb-4e80-8d00-b81ecce590a3,3,rokuro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :181a298d-96e1-4a21-aad0-7caa2cadaaa9,4,shiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :10273738-2d41-4584-93f8-4554d5cdd015,3,goro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :10dbfb93-c762-4557-83a4-b4e8fce3b57a,4,goro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :a284f196-84a4-4f2f-9828-3e0158857c75,4,rokuro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :78e8adb9-774f-40ec-8db9-35d87fe2c692,4,shiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :766966b8-c212-4336-ba34-e392754ddc1a,4,jiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :95d8fcf0-856f-4376-abda-9d1a0f518e52,3,shiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :a62e2530-8892-49fe-a2b7-90dcfe6a1a94,3,rokuro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :6a231e9e-7e1c-41bd-8578-bfc8aeb74828,4,rokuro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :abf89771-659a-4a26-927c-ac085851806e,3,saburo 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :81c4700d-6030-4569-aa83-6a1312d3032e,3,jiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :cd13459f-f74d-430f-994f-47755c6a61fc,3,saburo 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :b4611046-a331-477c-8379-c3de6f225c6e,4,shiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :6a85ae1b-2d78-4397-b46b-8d7ab4652711,4,shiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :d8e0bb66-f99f-41a6-a726-2cc6026966ea,4,jiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :cc758d94-b5c8-415c-94e9-29647e498995,4,shiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :823ead11-9213-40a4-8699-7cdd21a67825,3,jiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :b5997fc1-3009-48ca-a8d9-33656f59b8bc,3,saburo 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :9149e643-7a0b-4aea-bbe3-9f32474747d2,3,rokuro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :ea5c2f0f-05e4-42ea-8088-8a86961ddc64,4,shiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :972c8872-8328-489f-b842-de590834f907,4,rokuro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :bc2bd2e8-9f11-49c8-ac2e-1bf2de099ce2,3,saburo 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :64b846e5-9a4b-4b47-a2a6-601189a3bbbc,3,goro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :7724e31f-268b-4aac-b755-61f048483a13,4,jiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :7d98d23c-7ec1-4c0c-999c-4abdb9d8f52e,4,shiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :8c6a8e46-b65c-4209-b84a-5bd75f26d74b,3,saburo 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :a5f685e5-8cfa-4b42-a3f3-4beed0495a6d,3,rokuro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :ccf4e3c0-6eea-46f7-8b5b-dea70315f1fe,3,shiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :27a9c03c-7c3e-4bca-a7cf-5205b9ed064b,3,rokuro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :05cc34a7-9673-4da7-b4a7-1a504a94a6fb,4,shiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :6f44b1f9-d29f-4c07-bdc7-9554dc14ee97,3,shiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :a8a64c80-1421-4227-8048-e5d1d3060b26,4,shiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :5f28cf17-a204-4935-8b1b-429eee8eb327,3,goro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :9b962555-d358-4472-9bca-ec304e7358a9,4,saburo 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :e5063475-63d3-4aac-ab4c-228ee626717a,4,saburo 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :ac67cc40-ec81-4553-baa9-04ba9ecbf516,3,saburo 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :a385fb96-0cc4-4eb9-a0bd-8b99c3733f3f,3,jiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :26569d30-fb2f-470e-b3a9-d47d3e02b621,3,shiro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :e2c9bea6-bce5-498f-9a7c-90e15fad5b24,3,saburo 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :cf6e53cb-2f85-4ceb-b229-f4f5ac685914,3,saburo 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :039f10e0-2325-4453-9b85-592cfb4dfacf,3,rokuro 21:39:19.890 [main] INFO recordPattern.RecordPatternSample - delete :63631afd-433e-4620-a401-f423c852bcfb,3,shiro 21: 39: 19.900 [main] INFO recordPattern.RecordPatternSample --Display update data. 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :8df9c1a1-b6db-4bc0-b7dd-510cd7a3f3ce,1,rokuro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :2eb116e0-afe4-4c30-a562-82c28b33e0ca,2,saburo 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :dca9c586-5f80-46f2-bcb8-f1d6aa7470a6,1,shiro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :0c5c1e69-c58c-41f9-9a78-ef9bfc58e416,1,jiro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :57eab0b5-0cab-4982-9a99-15c1e54bb67d,2,shiro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :bac23a4d-fbd9-4e01-974e-5b4133c1b595,1,rokuro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :291129c5-30ad-4a58-9861-364790f0a637,1,rokuro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :c2941487-0185-46b0-8117-c4817bfe5147,1,saburo 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :ebaeb8c4-949f-4731-b803-5836b340a875,1,rokuro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :0ece9e7f-ed59-49cf-b5d0-20baf8deab78,2,rokuro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :32ce3fe9-cf1d-4e60-b6e3-e54404063cb6,1,rokuro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :74ed8852-6d6a-40e0-8923-a71023f72e6c,2,goro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :d0c4e7af-dde1-4c94-a047-600721215303,2,goro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :dfe53792-5b82-4338-8e4e-510e1e5099ef,3,goro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :30752912-5d69-42a8-8892-907972b2430e,1,shiro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :b74d351a-f038-4f7c-b718-3705dc71e07d,2,goro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :25ce82f5-d45b-4779-98f1-d0c16fad6594,1,saburo 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :3a67008e-7fa2-496b-b50c-341eb7e4fb18,1,shiro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :47d530b4-e88b-4bbe-a1db-0b3dc7e32773,2,jiro 21:39:19.900 [main] INFO recordPattern.RecordPatternSample - update :bd6151b8-70f2-40f2-b6e2-8c25a861ca99,2,shiro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :f475429b-10cc-49bb-9279-921e641f3952,1,goro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :6bd5f5f2-154a-435f-a43d-49d013023a10,2,shiro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :83245858-ff8f-4426-8462-c791e44e0f3c,2,shiro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :2d1f1380-0072-45cd-9452-024e137f9c1e,2,goro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :74c8a2e7-dd4f-4cfb-838f-32e62f799c2e,1,saburo 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :e4e92eb9-0c4f-483b-91ac-ef2132da6294,2,jiro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :a31e9986-5bfe-44de-977d-33ca4c3848ef,1,shiro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :b923f1ab-7324-4fbf-a13a-c16eadc4af7e,1,rokuro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :c97bf082-d689-43e9-bee5-f1c28274d138,2,goro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :e1754cc1-56c4-4e36-964d-1ab839bd2846,1,rokuro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :c8d1d9fe-7550-48cf-b568-110644075e19,1,saburo 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :6fcef8cf-a3c3-4581-8218-71feaa86eadf,2,rokuro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :bc6193a2-1702-480f-93ac-78b12e9a93dc,1,saburo 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :05a10afa-ffa8-4d23-b686-14d4325c3917,1,shiro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :8b37364d-e442-424b-b8df-e36e3fb30f2b,2,saburo 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :9e73f7d1-de2a-4ad0-9b16-a225001c1a5d,2,rokuro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :24a08049-ef2e-4c9f-b934-e2fa8853bbd5,1,jiro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :888744f4-0f49-4f01-8506-ab063ce2f778,1,shiro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :f8625d47-4183-4693-a4b4-048abe92e190,2,rokuro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :4d4a5b75-da44-475c-bccd-f3acb77d5e48,1,jiro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :7112029b-7e91-43ce-858e-b5cd1a15d127,1,shiro 21:39:19.908 [main] INFO recordPattern.RecordPatternSample - update :168d5fe9-e369-4d3d-956b-e9faa6c91a25,1,shiro 21:39:19.910 [main] INFO recordPattern.RecordPatternSample - update :a59b47ca-0233-49f6-ac27-4748687ef0a6,1,saburo 21:39:19.910 [main] INFO recordPattern.RecordPatternSample - update :15f73130-7a5e-41cc-b43f-0910fbfe9429,2,goro 21:39:19.910 [main] INFO recordPattern.RecordPatternSample - update :893b4348-ebce-4c43-8a45-3250bd3fc726,1,goro 21:39:19.910 [main] INFO recordPattern.RecordPatternSample - update :9cbd1993-bf0f-48b6-89e7-78fd0bb7c94c,2,jiro 21:39:19.910 [main] INFO recordPattern.RecordPatternSample - update :0cc04ce6-5698-4b38-9f3b-1d429c4f57e7,2,jiro 21:39:19.910 [main] INFO recordPattern.RecordPatternSample - update :02686803-4b17-4c0a-914e-ab04ba84e560,1,saburo 21: 39: 19.910 [main] INFO recordPattern.RecordPatternSample --Display of non-updated data. 21:39:19.910 [main] INFO recordPattern.RecordPatternSample - no modified :dada18a6-73e2-4eef-8c29-649fb24d8616,1,jiro 21:39:19.910 [main] INFO recordPattern.RecordPatternSample - no modified :3dd86959-d1c6-4e91-bdc8-be20e4ac7cdc,2,shiro >Process finished with exit code 0

In this way, by controlling the equivalence of objects and utilizing the collection API, it is possible to implement using the power of set operations.

[^ 1]: "General" is more convincing than "general purpose". The original text is written as "general contract". In the Japanese translation of the famous book "Effective Java", it is translated as "general contract". [^ 2]: Also in this article, when Implementing Compareable # compareTo in the Record class of the implementation example, there was a problem that the element disappeared from Set because it was made inconsistent with equals.

Recommended Posts

Recommendation of set operation by Java (and understanding of equals and hashCode)
Understanding equals and hashCode in Java
[Java] HashCode and equals overrides
The comparison of enums is ==, and equals is good [Java]
[Java] About Objects.equals () and Review of String comparisons (== and equals)
[Java] Beginner's understanding of Servlet-②
[Java] Difference between == and equals
Basics of character operation (java)
[Java] Beginner's understanding of Servlet-①
[Java] Set structure of collection class (about HashSet and TreeSet)
Advantages and disadvantages of Java
About fastqc of Biocontainers and Java
About the equals () and hashcode () methods
[Java] Output by FormatStyle of DateTimeFormatter
[Java beginner] == operator and equals method
Java pass by value and pass by reference
[Java] Judgment of identity and equivalence
Step-by-step understanding of Java exception handling
After 3 months of Java and Spring training
Summary of Docker understanding by beginners ② ~ docker-compose ~
The process of understanding Gemfile by non-engineers
About the operation of next () and nextLine ()
[Java / Swift] Comparison of Java Interface and Swift Protocol
[Java] Collection and StringBuilder operation method comparison
Summary of Java Math.random and import (Calendar)
[Java] Contents of Collection interface and List interface
Basics of java basics ② ~ if statement and switch statement ~
Discrimination of Enums in Java 7 and above
Summary of Docker understanding by beginners ④ ~ Until EC2 instance is started and docker is installed ~