test_class.file: rxcombodetector/src/test/java/com/github/piasy/rxcombodetector/RxComboDetectorTest.java
test_class.identifier: RxComboDetectorTest
test_case.body: @Test
      public void testDetect() {
          Flowable<Integer> mockClicks = Flowable
                  .create(emitter -> {
                      emitter.onNext(1);
                      sleepSilently(50);
                      emitter.onNext(1);
                      sleepSilently(50);
                      emitter.onNext(1);
                      sleepSilently(50);
                      emitter.onNext(1);
  
                      sleepSilently(150);
  
                      emitter.onNext(1);
                      sleepSilently(50);
                      emitter.onNext(1);
  
                      sleepSilently(150);
                      emitter.onNext(1);
  
                      sleepSilently(150);
                      emitter.onNext(1);
  
                      emitter.onComplete();
                  }, BackpressureStrategy.BUFFER);
  
          TestSubscriber<Integer> subscriber = new TestSubscriber<>();
          RxComboDetector.detect(mockClicks, 100, 2)
                  .subscribeOn(Schedulers.from(command -> new Thread(command).start()))
                  .subscribe(subscriber);
  
          subscriber.awaitTerminalEvent(30, TimeUnit.SECONDS);
          subscriber.assertValueCount(4);
          subscriber.assertValues(2, 3, 4, 2);
      }
test_case.class_method_signature: RxComboDetectorTest.testDetect()
test_case.full_signature: @Test public void testDetect()
test_case.identifier: testDetect
test_case.invocations: create onNext sleepSilently onNext sleepSilently onNext sleepSilently onNext sleepSilently onNext sleepSilently onNext sleepSilently onNext sleepSilently onNext onComplete subscribe subscribeOn detect from start awaitTerminalEvent assertValueCount assertValues
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDetect()
focal_class.declarator: DEFAULT_MAX_INTERVAL_MILLIS = 300
focal_class.modifier: private static final
focal_class.original_string: private static final long DEFAULT_MAX_INTERVAL_MILLIS = 300;
focal_class.type: long
focal_class.var_name: DEFAULT_MAX_INTERVAL_MILLIS
focal_class.declarator: DEFAULT_MIN_COMBO_TIMES_CARED = 2
focal_class.modifier: private static final
focal_class.original_string: private static final int DEFAULT_MIN_COMBO_TIMES_CARED = 2;
focal_class.type: int
focal_class.var_name: DEFAULT_MIN_COMBO_TIMES_CARED
focal_class.declarator: mTarget
focal_class.modifier: private final
focal_class.original_string: private final View mTarget;
focal_class.type: View
focal_class.var_name: mTarget
focal_class.declarator: mMaxIntervalMillis
focal_class.modifier: private final
focal_class.original_string: private final long mMaxIntervalMillis;
focal_class.type: long
focal_class.var_name: mMaxIntervalMillis
focal_class.declarator: mMinComboTimesCared
focal_class.modifier: private final
focal_class.original_string: private final int mMinComboTimesCared;
focal_class.type: int
focal_class.var_name: mMinComboTimesCared
focal_class.file: rxcombodetector/src/main/java/com/github/piasy/rxcombodetector/RxComboDetector.java
focal_class.identifier: RxComboDetector
focal_class.class_method_signature: RxComboDetector.RxComboDetector(View target, long maxIntervalMillis, int minComboTimesCared)
focal_class.full_signature: private  RxComboDetector(View target, long maxIntervalMillis, int minComboTimesCared)
focal_class.identifier: RxComboDetector
focal_class.modifiers: private
focal_class.parameters: (View target, long maxIntervalMillis, int minComboTimesCared)
focal_class.signature:  RxComboDetector(View target, long maxIntervalMillis, int minComboTimesCared)
focal_class.class_method_signature: RxComboDetector.detect(Flowable<Integer> clicks, final long maxIntervalMillis,
              final int minComboTimesCared)
focal_class.full_signature: @VisibleForTesting static Flowable<Integer> detect(Flowable<Integer> clicks, final long maxIntervalMillis,
              final int minComboTimesCared)
focal_class.identifier: detect
focal_class.modifiers: @VisibleForTesting static
focal_class.parameters: (Flowable<Integer> clicks, final long maxIntervalMillis,
              final int minComboTimesCared)
focal_class.return: Flowable<Integer>
focal_class.signature: Flowable<Integer> detect(Flowable<Integer> clicks, final long maxIntervalMillis,
              final int minComboTimesCared)
focal_class.class_method_signature: RxComboDetector.start()
focal_class.full_signature: public Flowable<Integer> start()
focal_class.identifier: start
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Flowable<Integer>
focal_class.signature: Flowable<Integer> start()
focal_class.class_method_signature: RxComboDetector.startAsV1Observable()
focal_class.full_signature: @Deprecated public rx.Observable<Integer> startAsV1Observable()
focal_class.identifier: startAsV1Observable
focal_class.modifiers: @Deprecated public
focal_class.parameters: ()
focal_class.return: rx.Observable<Integer>
focal_class.signature: rx.Observable<Integer> startAsV1Observable()
focal_method.body: @VisibleForTesting
      static Flowable<Integer> detect(Flowable<Integer> clicks, final long maxIntervalMillis,
              final int minComboTimesCared) {
          return clicks.timestamp()
                  .scan((lastOne, thisOne) -> {
                      if (thisOne.time() - lastOne.time() <= maxIntervalMillis) {
                          return new Timed<>(lastOne.value() + 1, thisOne.time(), thisOne.unit());
                      } else {
                          return new Timed<>(1, thisOne.time(), thisOne.unit());
                      }
                  })
                  .map(Timed::value)
                  .filter(combo -> combo >= minComboTimesCared);
      }
focal_method.class_method_signature: RxComboDetector.detect(Flowable<Integer> clicks, final long maxIntervalMillis,
              final int minComboTimesCared)
focal_method.full_signature: @VisibleForTesting static Flowable<Integer> detect(Flowable<Integer> clicks, final long maxIntervalMillis,
              final int minComboTimesCared)
focal_method.identifier: detect
focal_method.invocations: filter map scan timestamp time time value time unit time unit
focal_method.modifiers: @VisibleForTesting static
focal_method.parameters: (Flowable<Integer> clicks, final long maxIntervalMillis,
              final int minComboTimesCared)
focal_method.return: Flowable<Integer>
focal_method.signature: Flowable<Integer> detect(Flowable<Integer> clicks, final long maxIntervalMillis,
              final int minComboTimesCared)