source: class IntegratedComparatorTest {
  
      @Test
      public void testCycleReferenceCompare() {
  
target:         List<Comparator> comparators = new ArrayList<Comparator>();
          comparators.add(new SimpleComparator());
          comparators.add(new MapComparator());
          comparators.add(new ObjectComparator());
          IntegratedComparator comparator = new IntegratedComparator(comparators);
          Map<String, String> extensions = new HashMap<String, String>();
          extensions.put("name", "sandbox-repeater");
          extensions.put("version", "1.0.0");
          IntegratedCompareDO left = IntegratedCompareDO.builder()
                  .name("sandbox")
                  .character('s')
                  .extentions(extensions)
                  .salary(10000.0D)
                  .count(10)
                  .localDateTime(LocalDateTime.now())
                  .money(new BigDecimal(10000.0))
                  .student(Student.builder()
                          .name("YueBing")
                          .age(29)
                          .school("Peking University")
                          .build())
                  .build();
          IntegratedCompareDO right = IntegratedCompareDO.builder()
                  .name("repeater")
                  .character('t')
                  .extentions(extensions)
                  .salary(10000.1D)
                  .count(12)
                  .localDateTime(LocalDateTime.now())
                  .money(new BigDecimal(10000.0))
                  .student(Student.builder()
                          .name("YueBing")
                          .age(29)
                          .school("Tsinghua university")
                          .build())
                  .build();
          // make cycle reference
          left.setParent(right);
          right.setParent(left);
          CompareResult result = comparator.compare(left, right);
          Assert.assertNotEquals(result, null);
          Assert.assertTrue(result.hasDifference());
          Assert.assertEquals(result.getDifferences().size(), 10);
      }
  
  }