title: CompareTo using more than 1 attributes using Apache Commons CompareToBuilder
body: <p>I would like to sort an ArrayList of objects in Java 6. I would like the display the selected == TRUE at the top, then by billingConditionName in alphabetical order.</p>
  <pre><code>public int compare(IBillingConditionDTO o1, IBillingConditionDTO o2) {
        return new org.apache.commons.lang.builder.CompareToBuilder()
              .append(o1.getSelected(), o2.getSelected())
              .append(o1.getBillingConditionName(), o2.getBillingConditionName())
              .toComparison();
  </code></pre>
  <p>Result is those which are selected == TRUE are displayed first and within this list, it is then sorted alphabetically.</p>
  <p>Problem is those which are selected == FALSE are not sorted alphabetically.</p>
  <p>Sample result:</p>
  <pre><code>Selected, BillingConditionName
  true, containerSize
  true, containerType
  false, pod
  false, transType
  false, freight
  </code></pre>
  <p>I would like the result to be:</p>
  <pre><code>Selected, BillingConditionName
  true, containerSize
  true, containerType
  false, freight
  false, pod
  false, transType
  </code></pre>
  <p>Please help. thanks.</p>