test_class.declarator: comparator = new SimulationEventComparator()
test_class.original_string: Comparator<SimulationEvent> comparator = new SimulationEventComparator();
test_class.type: Comparator<SimulationEvent>
test_class.var_name: comparator
test_class.file: modules/flowable-crystalball/src/test/java/org/flowable/crystalball/simulator/SimulationEventComparatorTest.java
test_class.identifier: SimulationEventComparatorTest
test_case.body: @Test
      public void testCompare() throws Exception {
          SimulationEvent event1_0 = new SimulationEvent.Builder("type").simulationTime(0).build();
          SimulationEvent eq1_0 = new SimulationEvent.Builder("type").simulationTime(0).build();
          SimulationEvent event1_1 = new SimulationEvent.Builder("type").simulationTime(0).priority(1).build();
          SimulationEvent event2 = new SimulationEvent.Builder("type").simulationTime(1).build();
          assertThat(comparator.compare(event1_0, eq1_0)).isZero();
          assertThat(comparator.compare(event1_0, event2)).isEqualTo(-1);
          assertThat(comparator.compare(event2, event1_0)).isEqualTo(1);
          assertThat(comparator.compare(event1_0, event1_1)).isEqualTo(-1);
          assertThat(comparator.compare(event1_1, event1_0)).isEqualTo(1);
          assertThat(comparator.compare(event1_1, event2)).isEqualTo(-1);
          assertThat(comparator.compare(event2, event1_1)).isEqualTo(1);
      }
test_case.class_method_signature: SimulationEventComparatorTest.testCompare()
test_case.full_signature: @Test public void testCompare()
test_case.identifier: testCompare
test_case.invocations: build simulationTime build simulationTime build priority simulationTime build simulationTime isZero assertThat compare isEqualTo assertThat compare isEqualTo assertThat compare isEqualTo assertThat compare isEqualTo assertThat compare isEqualTo assertThat compare isEqualTo assertThat compare
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCompare()
focal_class.file: modules/flowable-crystalball/src/main/java/org/flowable/crystalball/simulator/SimulationEventComparator.java
focal_class.identifier: SimulationEventComparator
focal_class.interfaces: implements Comparator<SimulationEvent>
focal_class.class_method_signature: SimulationEventComparator.compare(SimulationEvent o1, SimulationEvent o2)
focal_class.full_signature: @Override public int compare(SimulationEvent o1, SimulationEvent o2)
focal_class.identifier: compare
focal_class.modifiers: @Override public
focal_class.parameters: (SimulationEvent o1, SimulationEvent o2)
focal_class.return: int
focal_class.signature: int compare(SimulationEvent o1, SimulationEvent o2)
focal_method.body: @Override
      public int compare(SimulationEvent o1, SimulationEvent o2) {
          // the highest priority has simulation time
          if (o1.getSimulationTime() < o2.getSimulationTime())
              return -1;
          if (o1.getSimulationTime() > o2.getSimulationTime())
              return 1;
          // in case of equal simulation time, take priority into account
          if (o1.getPriority() < o2.getPriority())
              return -1;
          if (o1.getPriority() > o2.getPriority())
              return 1;
          return 0;
      }
focal_method.class_method_signature: SimulationEventComparator.compare(SimulationEvent o1, SimulationEvent o2)
focal_method.full_signature: @Override public int compare(SimulationEvent o1, SimulationEvent o2)
focal_method.identifier: compare
focal_method.invocations: getSimulationTime getSimulationTime getSimulationTime getSimulationTime getPriority getPriority getPriority getPriority
focal_method.modifiers: @Override public
focal_method.parameters: (SimulationEvent o1, SimulationEvent o2)
focal_method.return: int
focal_method.signature: int compare(SimulationEvent o1, SimulationEvent o2)