One of the commonly asked questions that GeoTools users have is in the use of FeatureCollections and DataStores. This post discusses how to sort a set of features based on attributes. The following code shows how to load a shapefile and the build a Query object to sort the results.
Running this program will produce the following output:
District of Columbia: 606900.0
North Dakota: 638800.0
South Dakota: 696004.0
New York: 1.8235907E7