How can i sort it : <pre><code>[{TIME21=0, TIME22=2, TIME23=0, TIME12=0, TIME13=1, LOAN_AMT=500, TIME10=0, TIME20=0, TIME11=1, TIME17=0, TIME9=2, TIME16=0, TIME15=0, TIME14=1, TIME5=0, REG_DT=20170517, TIME6=0, TIME19=0, TIME7=0, TIME18=1, TIME8=4, TIME1=0, TIME2=0, TIME3=0, TIME4=0, TIME0=0}, {TIME21=3, TIME22=2, TIME23=3, TIME12=6, TIME13=7, LOAN_AMT=1000, TIME10=8, TIME20=2, TIME11=6, TIME17=6, TIME9=7, TIME16=2, TIME15=7, TIME14=5, TIME5=0, REG_DT=20170517, TIME6=1, TIME19=1, TIME7=3, TIME18=1, TIME8=5, TIME1=0, TIME2=1, TIME3=0, TIME4=0, TIME0=3}]
</code></pre>

<p>This is a list,the form is List>, i want to sort it let it show like TIME1,TIME2......，how i should to do it, and the TIME1 like this that it type is BigDecimal, this is my code,but it dose not worked</p>

<pre><code>for (Map&lt;String, Object&gt; dataMap : chartData) {
            List&lt;Object&gt; objs = new ArrayList&lt;Object&gt;();
            for (final Map.Entry&lt;String, Object&gt; entry : dataMap.entrySet()) {
                Collections.sort(chartData,new Comparator&lt;Map&lt;String, Object&gt;&gt;() {
                    @Override
                    public int compare(Map&lt;String, Object&gt; o1, Map&lt;String, Object&gt; o2) {
                        BigDecimal s1 = (BigDecimal) o1.get(entry.getKey());
                        BigDecimal s2 = (BigDecimal) o2.get(entry.getKey());
                        int result = s1.compareTo(s2);
                        if (result &lt; 0) {
                            System.out.println("a &lt; b");
                            return 1;
                        }else {
                            System.out.println("a&gt;b");
                            return -1;
                        }
                    }

                });
            }
        }
</code></pre>
