Friday, February 05, 2016

Java 8 collections content order

It is observed that in Java 8, the content in Collections has different order than previous Java.

To compare the equality of content in two Collections, the safer strategy becomes:

1. Convert name=value pair to Collections.
http://stackoverflow.com/questions/13592236/parse-a-uri-string-into-name-value-collection

2. assertTrue(org.apache.commons.collections.CollectionUtils.isEqualCollection(Collection a, Collection b));