title: How to define a custom Set implementation to be used for <set></set>
body: <p>While working with Spring i am facing a strange issue.i have a class which takes a set as an input since the class is of underlying framework so i can not change it.
  Here is its declaration</p>
  
  <pre><code>private Set evaluate;
  
  public Set getEvaluate()
      {
          return evaluate;
      }
  
  public void setEvaluate(Set evaluate)
      {
          this.evaluate = evaluate;
      }
  </code></pre>
  
  <p>i am spring file i have following entry</p>
  
  <pre><code>&lt;bean id="customService"
          class="com.platform.impl.DefaultFrameworkService"
          scope="tenant" parent="abstractService"&gt;
          &lt;property name="evaluate"&gt;
              &lt;set&gt;
                  &lt;ref bean="bean1" /&gt;
                  &lt;ref bean="bean2" /&gt;
                  &lt;ref bean="bean3" /&gt;
                   &lt;!-- inject new bean here. --&gt;
                  &lt;ref bean="bean4" /&gt;
              &lt;/set&gt;
          &lt;/property&gt;
  </code></pre>
  
  <p>here <code>DefaultFrameworkService</code> takes set as input. so all i am trying is to inject a new bean to the underlying service.</p>
  
  <p>My problem is when spring read this file it convert this <code>&lt;set&gt;</code> entry of sprong.xml to <code>LinkedHashSet</code> and than try to set these values to  <code>private Set evaluate</code> which ultimately throwing exception.</p>
  
  <p>Though i can always override the <code>DefaultFrameworkService</code> and than can convert that <code>LinkedHashSet</code> to set but want to look for better way.</p>
  
  <p>Exception i m getting is</p>
  
  <pre><code>Failed to convert property value of type 'java.util.LinkedHashSet' to required type 'java.util.Set' for property 'evaluate'
  </code></pre>
  
  <p>How can i make spring to pass value only as a <code>set</code> and not <code>LinkedHashSet</code></p>
  
  <p><strong>Update</strong></p>
  
  <p>I was unable to set all these even so i played around a bit created a new customclass namely <code>CustomDefaultFrameworkService</code> with following implimentation</p>
  
  <pre><code>public class CustomDefaultFrameworkService extends DefaultFrameworkService
  {
  
      Logger log = Logger.getLogger(CustomDefaultFrameworkService.class);
      @SuppressWarnings("unused")
      private Set evaluate;
  
      /**
       * @param evaluateStrategies
       *           the evaluateStrategies to set
       */
      @Override
      public void setEvaluate(final Set evaluate)
      {
          log.info("Setting  values to super class. Total values being injected are " + evaluateStrategies.size());
          super.setEvaluate(evaluate);
  
      }
  }
  </code></pre>
  
  <p>and i am able to set map to super class.This thing has made me more confused.</p>