I have the following problem: I have a HashMap
HashMap <String, BeanRelEstatisticaMateriaPrima> dataBeanList = new HashMap ();
And I am generating an iReport report, but to send the data to the report, I do a HashMap conversion to an ArrayList:
List <BeanRelEstatisticaMateriaPrima> test = new ArrayList <BeanRelEstatisticaMateriaPrima> (dataBeanList.values ());
JRBeanCollectionDataSource beanColDataSource = new JRBeanCollectionDataSource (test);
But in doing this conversion, ordination is being lost. In the hashmap I have in alphabetical order, eg: (A, B, C, D, E) but in the ArrayList it gets (D, A, E, C, B)
Is there a way to transform to ArrayList by keeping the sort order exactly the same as HashMap?