public UspstfSpecificRecommendation getSpecificUspstfSpecificRecommendation(int index) {
   init();
   if (index < 0) {
     index = 0;
   }
   if (index > (data.size() - 1)) {
     index = data.size() - 1;
   }
   UspstfSpecificRecommendation obj = data.get(index);
   Long id = obj.getId_();
   return uspstfSpecificRecommendationService.findUspstfSpecificRecommendation(id);
 }
  public void init() {
    int from = 0;
    int to = 10;
    data = uspstfSpecificRecommendationService.findUspstfSpecificRecommendationEntries(from, to);
    if (data == null) {
      throw new IllegalStateException(
          "Find entries implementation for 'UspstfSpecificRecommendation' illegally returned null");
    }
    if (!data.isEmpty()) {
      return;
    }

    data = new ArrayList<UspstfSpecificRecommendation>();
    for (int i = 0; i < 10; i++) {
      UspstfSpecificRecommendation obj = getNewTransientUspstfSpecificRecommendation(i);
      try {
        uspstfSpecificRecommendationService.saveUspstfSpecificRecommendation(obj);
      } catch (final ConstraintViolationException e) {
        final StringBuilder msg = new StringBuilder();
        for (Iterator<ConstraintViolation<?>> iter = e.getConstraintViolations().iterator();
            iter.hasNext(); ) {
          final ConstraintViolation<?> cv = iter.next();
          msg.append("[")
              .append(cv.getRootBean().getClass().getName())
              .append(".")
              .append(cv.getPropertyPath())
              .append(": ")
              .append(cv.getMessage())
              .append(" (invalid value = ")
              .append(cv.getInvalidValue())
              .append(")")
              .append("]");
        }
        throw new IllegalStateException(msg.toString(), e);
      }
      uspstfSpecificRecommendationRepository.flush();
      data.add(obj);
    }
  }
 public UspstfSpecificRecommendation getRandomUspstfSpecificRecommendation() {
   init();
   UspstfSpecificRecommendation obj = data.get(rnd.nextInt(data.size()));
   Long id = obj.getId_();
   return uspstfSpecificRecommendationService.findUspstfSpecificRecommendation(id);
 }