title: Why the elements in the queue are the same
body: <p>In the project I was responsible for the mail sending function, but in the use of the queue when there is a problem.</p>
  
  <pre><code>private void createReportEmail()
  {
      try
      {
          List&lt;Map&gt; list = emailMapper.getToAddress();
          System.out.println(list);
          MailSenderInfo mailSenderInfo = new MailSenderInfo();
          mailSenderInfo = CreateEmailService.sendReportMail(emailMapper);
          InternetAddress address = new InternetAddress();
          for (int i = 0; i &lt; list.size(); i++)
          {
              if (list.get(i).get("address").toString() != null &amp;&amp; list.get(i).get("address").toString() != "")
                  address = new InternetAddress(list.get(i).get("address").toString());
              MailSenderInfo mailSenderInfo2 = new MailSenderInfo();
              mailSenderInfo2 = mailSenderInfo;
              mailSenderInfo2.setAddress(address);
              queue.offer(mailSenderInfo2);
          }
          for(int i =0;i&lt;list.size();++i)
          {
              System.out.println(queue.poll().getAddress());
          }
  
      } catch (Exception e)
      {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>Now I'm sure the elements in the List are different from each other, but all that's stored in the queue is the content of the last element of the list.I want to know why</p>