test_class.file: app/src/test/java/org/eyeseetea/malariacare/domain/service/OverLimitSurveysDomainServiceTest.java
test_class.identifier: OverLimitSurveysDomainServiceTest
test_case.body: @Test
      public void
      should_return_false_if_surveys_count_is_under_threshold_and_difference_time_is_over_threshold
              () {
          List<Survey> surveys = givenThereAre30SurveysIn2Hours();
  
          SurveysThresholds surveyThreshold =
                  new SurveysThresholdBuilder()
                          .withCount(40)
                          .withTimeHour(1)
                          .build();
  
          boolean isOverLimit = OverLimitSurveysDomainService.isSurveysOverLimit(surveys,
                  surveyThreshold);
  
          assertThat(isOverLimit, is(false));
      }
test_case.class_method_signature: OverLimitSurveysDomainServiceTest.should_return_false_if_surveys_count_is_under_threshold_and_difference_time_is_over_threshold()
test_case.full_signature: @Test public void should_return_false_if_surveys_count_is_under_threshold_and_difference_time_is_over_threshold()
test_case.identifier: should_return_false_if_surveys_count_is_under_threshold_and_difference_time_is_over_threshold
test_case.invocations: givenThereAre30SurveysIn2Hours build withTimeHour withCount isSurveysOverLimit assertThat is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void should_return_false_if_surveys_count_is_under_threshold_and_difference_time_is_over_threshold()
focal_class.file: app/src/main/java/org/eyeseetea/malariacare/domain/service/OverLimitSurveysDomainService.java
focal_class.identifier: OverLimitSurveysDomainService
focal_class.class_method_signature: OverLimitSurveysDomainService.isSurveysOverLimit(List<Survey> surveys,
              SurveysThresholds surveysThresholds)
focal_class.full_signature: public static boolean isSurveysOverLimit(List<Survey> surveys,
              SurveysThresholds surveysThresholds)
focal_class.identifier: isSurveysOverLimit
focal_class.modifiers: public static
focal_class.parameters: (List<Survey> surveys,
              SurveysThresholds surveysThresholds)
focal_class.return: boolean
focal_class.signature: boolean isSurveysOverLimit(List<Survey> surveys,
              SurveysThresholds surveysThresholds)
focal_class.class_method_signature: OverLimitSurveysDomainService.sortSurveysByDate(List<Survey> surveys)
focal_class.full_signature: private static void sortSurveysByDate(List<Survey> surveys)
focal_class.identifier: sortSurveysByDate
focal_class.modifiers: private static
focal_class.parameters: (List<Survey> surveys)
focal_class.return: void
focal_class.signature: void sortSurveysByDate(List<Survey> surveys)
focal_method.body: public static boolean isSurveysOverLimit(List<Survey> surveys,
              SurveysThresholds surveysThresholds) {
  
          if (surveysThresholds.getCount() > 0 &&
                  surveysThresholds.getTimeHours() > 0 &&
                  surveys.size() >= surveysThresholds.getCount()) {
  
              sortSurveysByDate(surveys);
  
              long firstSurveyDate = surveys.get(0).getSurveyDate().getTime();
              long lastSurveyDate = surveys.get(surveys.size() - 1).getSurveyDate().getTime();
  
              long timeDifference = TimeUnit.MILLISECONDS.toHours(lastSurveyDate - firstSurveyDate);
  
              return (timeDifference <= surveysThresholds.getTimeHours());
          }
          return false;
      }
focal_method.class_method_signature: OverLimitSurveysDomainService.isSurveysOverLimit(List<Survey> surveys,
              SurveysThresholds surveysThresholds)
focal_method.full_signature: public static boolean isSurveysOverLimit(List<Survey> surveys,
              SurveysThresholds surveysThresholds)
focal_method.identifier: isSurveysOverLimit
focal_method.invocations: getCount getTimeHours size getCount sortSurveysByDate getTime getSurveyDate get getTime getSurveyDate get size toHours getTimeHours
focal_method.modifiers: public static
focal_method.parameters: (List<Survey> surveys,
              SurveysThresholds surveysThresholds)
focal_method.return: boolean
focal_method.signature: boolean isSurveysOverLimit(List<Survey> surveys,
              SurveysThresholds surveysThresholds)