code: public static int limit(int number, int between, int and) {
          if (number <= between) {
              return between;
          }
          if (number >= and) {
              return and;
          }
          return number;
      }
docs: Limits the given <b>number</b> between the other values
  @param number  The number to limit.
  @param between The smallest value the number can take.
  @param and     The biggest value the number can take.
  @return The limited number.