Test value before attempting to insert it in to the dictionary (note: following the current coding style for this class).