code: protected boolean valueMatches(Integer required, int current, boolean min, boolean max)
      {
          if (required != null)
          {
              if (min)
                  return (current >= required);
              else if (max)
                  return (current <= required);
              else
                  return current == required;
          }
          else
              return false; //invalid values don't match
      }
docs: Checks whether a value coresponds to the given criteria.
  @param required the required value
  @param current the tested value or {@code null} for invalid value
  @param min {@code true} when the required value is the minimal one
  @param max {@code true} when the required value is the maximal one
  @return {@code true} when the value matches the criteria.