> + } > + } > + > + /** > + * Builds a TreeHash based on a map of hashed chunks. > + * > + * @return The calculated TreeHash. > + * @see <a > href="http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html" > /> > + */ > + public static HashCode buildTreeHashFromMap(Map<Integer, HashCode> > map) { > + //Sort the Map with the hash parts. > + SortedMap<Integer, HashCode> sortedMap = > ImmutableSortedMap.copyOf(map); > + > + //Convert the strings and add them to our queue. > + ArrayList<HashCode> list = Lists.newArrayList(); > + for (Map.Entry<Integer, HashCode> entry : sortedMap.entrySet()) {
You can write this more succinctly as: ``` List<HashCode> list = Lists.newArrayList(ImmutableSortedMap.copyOf(map).values()); ``` You might not need the `ArrayList` copy if you change some of the methods to take a `Collection` instead. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-aws/pull/11/files#r13825893
