public Message(String type,double value){
  if (!VALID_TYPES.contains(type)) {
    throw new IllegalArgumentException(type + " is not a valid message type.\n" + "Valid message types are \"FAST\", \"MEDIUM\", and \"SLOW\".");
  }
  this.type=type;
  this.value=value;
}

public Message ( String type , double value ) { if ( ! VALID_TYPES . contains ( type ) ) { throw new IllegalArgumentException ( type + " is not a valid message type.\n" + "Valid message types are \"FAST\", \"MEDIUM\", and \"SLOW\"." ) ; } this . type = type ; this . value = value ; }
creates a new message from the type and the value .
