Index: src/uk/me/parabola/imgfmt/app/lbl/Highway.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/lbl/Highway.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/lbl/Highway.java	(working copy)
@@ -17,7 +17,6 @@
 package uk.me.parabola.imgfmt.app.lbl;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import uk.me.parabola.imgfmt.app.ImgFileWriter;
@@ -65,7 +64,7 @@
 		if(extraData) {
 			writer.put1u(0);
 			writer.put2u(region == null? 0 : region.getIndex());
-			Collections.sort(exits);
+			exits.sort(null);
 			for(ExitPoint ep : exits) {
 				writer.put1u(ep.index);
 				writer.put2u(ep.div.getNumber());
Index: src/uk/me/parabola/imgfmt/app/lbl/PlacesFile.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/lbl/PlacesFile.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/lbl/PlacesFile.java	(working copy)
@@ -17,7 +17,6 @@
 package uk.me.parabola.imgfmt.app.lbl;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -92,17 +91,10 @@
 
 		for (List<POIIndex> pil : poiIndex) {
 			if(pil != null) {
-				// sort entries by POI name
-				List<SortKey<POIIndex>> sorted = new ArrayList<>();
-				for (POIIndex index : pil) {
-					SortKey<POIIndex> sortKey = sort.createSortKey(index, index.getName());
-					sorted.add(sortKey);
-				}
-				Collections.sort(sorted);
-
-				for (SortKey<POIIndex> key : sorted) {
-					key.getObject().write(writer);
-				}
+				// sort entries by POI name and write them
+				pil.stream().map(index -> sort.createSortKey(index, index.getName()))
+				.sorted()
+				.forEach(key -> key.getObject().write(writer));
 			}
 		}
 		placeHeader.endPOIIndex(writer.position());
@@ -342,7 +334,7 @@
 			SortKey<Country> key = sort.createSortKey(c, c.getLabel());
 			keys.add(key);
 		}
-		Collections.sort(keys);
+		keys.sort(null);
 
 		countryList.clear();
 		int index = 1;
@@ -362,7 +354,7 @@
 			SortKey<Region> key = sort.createSortKey(r, r.getLabel(), r.getCountry().getIndex());
 			keys.add(key);
 		}
-		Collections.sort(keys);
+		keys.sort(null);
 
 		regionList.clear();
 		int index = 1;
@@ -383,7 +375,7 @@
 			sortKey = new CombinedSortKey<>(sortKey, c.getRegionNumber(), c.getCountryNumber());
 			keys.add(sortKey);
 		}
-		Collections.sort(keys);
+		keys.sort(null);
 
 		cityList.clear();
 		int index = 1;
@@ -400,7 +392,7 @@
 			SortKey<Zip> sortKey = sort.createSortKey(c, c.getLabel());
 			keys.add(sortKey);
 		}
-		Collections.sort(keys);
+		keys.sort(null);
 
 		zipList.clear();
 		int index = 1;
Index: src/uk/me/parabola/imgfmt/app/mdr/LargeListSorter.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/LargeListSorter.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/mdr/LargeListSorter.java	(working copy)
@@ -13,7 +13,6 @@
  package uk.me.parabola.imgfmt.app.mdr;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -66,7 +65,7 @@
 				keys.add(makeKey(list.get(i), sort, cache));
 			}
 			cache = null;
-			Collections.sort(keys);
+			keys.sort(null);
 			
 			for (int i = 0; i < keys.size(); i++){ 
 				SortKey<T> sk = keys.get(i);
Index: src/uk/me/parabola/imgfmt/app/mdr/Mdr10.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/Mdr10.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/mdr/Mdr10.java	(working copy)
@@ -13,7 +13,6 @@
 package uk.me.parabola.imgfmt.app.mdr;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -70,7 +69,7 @@
 			if (poiGroup == null)
 				continue;
 			
-			Collections.sort(poiGroup);
+			poiGroup.sort(null);
 
 			String lastName = null;
 			int lastSub = -1;
Index: src/uk/me/parabola/imgfmt/app/mdr/Mdr13.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/Mdr13.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/mdr/Mdr13.java	(working copy)
@@ -13,7 +13,6 @@
 package uk.me.parabola.imgfmt.app.mdr;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import uk.me.parabola.imgfmt.app.ImgFileWriter;
@@ -35,7 +34,7 @@
 	}
 	
 	public void writeSectData(ImgFileWriter writer) {
-		Collections.sort(regions);
+		regions.sort(null);
 
 		for (Mdr13Record region : regions) {
 			putMapIndex(writer, region.getMapIndex());
Index: src/uk/me/parabola/imgfmt/app/mdr/Mdr14.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/Mdr14.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/mdr/Mdr14.java	(working copy)
@@ -13,7 +13,6 @@
 package uk.me.parabola.imgfmt.app.mdr;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import uk.me.parabola.imgfmt.app.ImgFileWriter;
@@ -31,7 +30,7 @@
 	}
 
 	public void writeSectData(ImgFileWriter writer) {
-		Collections.sort(countries);
+		countries.sort(null);
 		
 		for (Mdr14Record country : countries) {
 			putMapIndex(writer, country.getMapIndex());
Index: src/uk/me/parabola/imgfmt/app/mdr/Mdr19.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/Mdr19.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/mdr/Mdr19.java	(working copy)
@@ -13,8 +13,6 @@
 package uk.me.parabola.imgfmt.app.mdr;
 
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
 
 import uk.me.parabola.imgfmt.app.ImgFileWriter;
@@ -26,7 +24,7 @@
  */
 public class Mdr19 extends MdrSection implements HasHeaderFlags {
 	private List<Mdr11Record> pois;
-	private final List<Mdr18Record> poiTypes = new ArrayList<Mdr18Record>();
+	private final List<Mdr18Record> poiTypes = new ArrayList<>();
 
 	public Mdr19(MdrConfig config) {
 		setConfig(config);
@@ -35,19 +33,12 @@
 	/**
 	 * Sort the pois by type.
 	 */
+	@Override
 	public void preWriteImpl() {
-		Collections.sort(pois, new Comparator<Mdr11Record>() {
-			public int compare(Mdr11Record o1, Mdr11Record o2) {
-				// For mainly historical reasons, we keep the element type in a number of different
-				// formats. Need to normalise it before sorting.
-				int t1 = MdrUtils.fullTypeToNaturalType(o1.getType());
-				int t2 = MdrUtils.fullTypeToNaturalType(o2.getType());
-
-				if (t1 == t2) return 0;
-				else if (t1 < t2) return -1;
-				else return 1;
-			}
-		});
+		// For mainly historical reasons, we keep the element type in a number
+		// of different formats. Need to normalise it before sorting.
+		pois.sort((o1, o2) -> Integer.compare(MdrUtils.fullTypeToNaturalType(o1.getType()),
+				MdrUtils.fullTypeToNaturalType(o2.getType())));
 	}
 
 	/**
@@ -92,6 +83,7 @@
 	 * Release the copy of the pois. The other index is small and not worth
 	 * worrying about.
 	 */
+	@Override
 	protected void releaseMemory() {
 		pois = null;
 	}
Index: src/uk/me/parabola/imgfmt/app/mdr/Mdr20.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/Mdr20.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/mdr/Mdr20.java	(working copy)
@@ -14,10 +14,8 @@
 package uk.me.parabola.imgfmt.app.mdr;
 
 import java.text.Collator;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * This is a list of streets that belong to each city.
@@ -49,15 +47,12 @@
 	 * @param list 
 	 */
 	public void buildFromStreets(List<Mdr7Record> inStreets) {
-		ArrayList<Mdr7Record> sorted = new ArrayList<>(inStreets);
-		Collections.sort(sorted, new Comparator<Mdr7Record>() {
-			public int compare(Mdr7Record o1, Mdr7Record o2) {
-				int d = Integer.compare(o1.getCity().getMdr20SortPos(), o2.getCity().getMdr20SortPos());
-				if (d != 0)
-					return d;
-				return Integer.compare(o1.getIndex(), o2.getIndex());
-			}
-		});
+		List<Mdr7Record> sorted = inStreets.stream().sorted((o1, o2) -> {
+			int d = Integer.compare(o1.getCity().getMdr20SortPos(), o2.getCity().getMdr20SortPos());
+			if (d != 0)
+				return d;
+			return Integer.compare(o1.getIndex(), o2.getIndex());
+		}).collect(Collectors.toList());
 
 		Collator collator = getConfig().getSort().getCollator();
 		collator.setStrength(Collator.SECONDARY);
@@ -96,9 +91,7 @@
 	 * Two streets are in the same group if they have the same mdr20 id.
 	 */
 	protected boolean sameGroup(Mdr7Record street1, Mdr7Record street2) {
-		if (street2 != null && street1.getCity().getMdr20() == street2.getCity().getMdr20())
-			return true;
-		return false;
+		return street2 != null && street1.getCity().getMdr20() == street2.getCity().getMdr20();
 	}
 
 	/**
Index: src/uk/me/parabola/imgfmt/app/mdr/Mdr21.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/Mdr21.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/mdr/Mdr21.java	(working copy)
@@ -12,10 +12,8 @@
  */
 package uk.me.parabola.imgfmt.app.mdr;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * This section contains the streets sorted by region.
@@ -37,21 +35,15 @@
 	 * @param inStreets The list of streets from mdr7.
 	 */
 	public void buildFromStreets(List<Mdr7Record> inStreets) {
-		ArrayList<Mdr7Record> sorted = new ArrayList<>(inStreets.size());
-		for (Mdr7Record street : inStreets) {
-			if (street.getCity() != null && street.getCity().getMdrRegion() != null)
-				sorted.add(street);
-		}
-		Collections.sort(sorted, new Comparator<Mdr7Record>() {
-			public int compare(Mdr7Record o1, Mdr7Record o2) {
-				int d = Integer.compare(o1.getCity().getMdr21SortPos(), o2.getCity().getMdr21SortPos());
-				if (d != 0)
-					return d;
-				return Integer.compare(o1.getIndex(), o2.getIndex());
-			}
-		});
+		List<Mdr7Record> sorted = inStreets.stream()
+				.filter(s -> s.getCity() != null && s.getCity().getMdrRegion() != null)
+				.sorted((o1, o2) -> {
+					int d = Integer.compare(o1.getCity().getMdr21SortPos(), o2.getCity().getMdr21SortPos());
+					if (d != 0)
+						return d;
+					return Integer.compare(o1.getIndex(), o2.getIndex());
 
-
+				}).collect(Collectors.toList());
 		int lastIndex = -1;
 		int record = 0;
 		for (Mdr7Record street : sorted) {
Index: src/uk/me/parabola/imgfmt/app/mdr/Mdr22.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/Mdr22.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/mdr/Mdr22.java	(working copy)
@@ -13,10 +13,9 @@
 
 package uk.me.parabola.imgfmt.app.mdr;
 
-import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * Index of streets by country.
@@ -43,23 +42,17 @@
 	 * @param inStreets The list of streets from mdr7.
 	 */
 	public void buildFromStreets(List<Mdr7Record> inStreets) {
-		ArrayList<Mdr7Record> sorted = new ArrayList<>(inStreets.size());
-		for (Mdr7Record street : inStreets) {
-			if (street.getCity() != null) {
-				assert street.getCity().getCountryName() != null;
-				sorted.add(street);
-			}
-		}
-		Collections.sort(sorted, new Comparator<Mdr7Record>() {
-			public int compare(Mdr7Record o1, Mdr7Record o2) {
-				int d = Integer.compare(o1.getCity().getMdr22SortPos(), o2.getCity().getMdr22SortPos());
-				if (d != 0)
-					return d;
-				return Integer.compare(o1.getIndex(), o2.getIndex());
-			}
-		});
+		List<Mdr7Record> sorted = inStreets.stream()
+				.filter(s -> s.getCity() != null && s.getCity().getCountryName()!= null)
+				.sorted((o1, o2) -> {
+					int d = Integer.compare(o1.getCity().getMdr22SortPos(), o2.getCity().getMdr22SortPos());
+					if (d != 0)
+						return d;
+					return Integer.compare(o1.getIndex(), o2.getIndex());
 
+				}).collect(Collectors.toList());
 
+
 		int lastIndex = -1;
 		int record = 0;
 		for (Mdr7Record street : sorted) {
@@ -77,7 +70,6 @@
 				lastIndex = street.getIndex();
 			}
 		}
-		return;
 	}
 
 	protected boolean sameGroup(Mdr7Record street1, Mdr7Record street2) {
Index: src/uk/me/parabola/imgfmt/app/mdr/Mdr25.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/Mdr25.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/mdr/Mdr25.java	(working copy)
@@ -13,7 +13,6 @@
 package uk.me.parabola.imgfmt.app.mdr;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import uk.me.parabola.imgfmt.app.ImgFileWriter;
@@ -45,7 +44,7 @@
 			keys.add(key);
 		}
 
-		Collections.sort(keys);
+		keys.sort(null);
 
 		String lastName = null;
 		Mdr5Record lastCity = null;
Index: src/uk/me/parabola/imgfmt/app/mdr/Mdr26.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/Mdr26.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/mdr/Mdr26.java	(working copy)
@@ -13,7 +13,6 @@
 package uk.me.parabola.imgfmt.app.mdr;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import uk.me.parabola.imgfmt.app.ImgFileWriter;
@@ -41,7 +40,7 @@
 			SortKey<Mdr28Record> key = sort.createSortKey(mdr28, mdr28.getMdr14().getName(), ++record);
 			sortList.add(key);
 		}
-		Collections.sort(sortList);
+		sortList.sort(null);
 
 		addToIndex(sortList);
 	}
Index: src/uk/me/parabola/imgfmt/app/mdr/Mdr27.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/Mdr27.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/mdr/Mdr27.java	(working copy)
@@ -13,7 +13,6 @@
 package uk.me.parabola.imgfmt.app.mdr;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import uk.me.parabola.imgfmt.app.ImgFileWriter;
@@ -48,7 +47,7 @@
 			}
 		}
 
-		Collections.sort(keys);
+		keys.sort(null);
 
 		String lastName = null;
 		int record = 0;
Index: src/uk/me/parabola/imgfmt/app/mdr/Mdr4.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/Mdr4.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/mdr/Mdr4.java	(working copy)
@@ -13,7 +13,6 @@
 package uk.me.parabola.imgfmt.app.mdr;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -37,7 +36,7 @@
 	
 	public void writeSectData(ImgFileWriter writer) {
 		List<Mdr4Record> list = new ArrayList<Mdr4Record>(poiTypes);
-		Collections.sort(list);
+		list.sort(null);
 
 		for (Mdr4Record r : list) {
 			writer.put1u(r.getType());
Index: src/uk/me/parabola/imgfmt/app/mdr/Mdr5.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/Mdr5.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/mdr/Mdr5.java	(working copy)
@@ -68,7 +68,7 @@
 			sortKey = new MultiSortKey<>(sortKey, regionKey, countryKey);
 			sortKeys.add(sortKey);
 		}
-		Collections.sort(sortKeys);
+		sortKeys.sort(null);
 
 		Collator collator = getConfig().getSort().getCollator();
 
@@ -121,7 +121,7 @@
 			sortKey = new MultiSortKey<>(sortKey, regionKey, countryKey);
 			sortKeys.add(sortKey);
 		}
-		Collections.sort(sortKeys);
+		sortKeys.sort(null);
 
 		SortKey<Mdr5Record> lastKey = null;
 		int pos = 0;
@@ -147,7 +147,7 @@
 			// Sort by region name.
 			sortKeys.add(sort.createSortKey(m, m.getRegionName()));
 		}
-		Collections.sort(sortKeys);
+		sortKeys.sort(null);
 
 		SortKey<Mdr5Record> lastKey = null;
 		int pos = 0;
@@ -175,7 +175,7 @@
 			SortKey<Mdr5Record> countryKey = sort.createSortKey(m, m.getCountryName());
 			sortKeys.add(countryKey);
 		}
-		Collections.sort(sortKeys);
+		sortKeys.sort(null);
 
 		SortKey<Mdr5Record> lastKey = null;
 		int pos = 0;
Index: src/uk/me/parabola/imgfmt/app/mdr/MdrUtils.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/MdrUtils.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/mdr/MdrUtils.java	(working copy)
@@ -12,9 +12,8 @@
  */
 package uk.me.parabola.imgfmt.app.mdr;
 
-import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
+import java.util.stream.Collectors;
 
 import uk.me.parabola.imgfmt.app.srt.Sort;
 import uk.me.parabola.imgfmt.app.srt.SortKey;
@@ -86,7 +85,7 @@
 	}
 
 	/**
-	 * Sort records that are sorted by a name.  They appropriate sort order will be used.
+	 * Sort records that are to be sorted by a name. The appropriate sort order will be used.
 	 * @param sort The sort to be applied.
 	 * @param list The list to be sorted.
 	 * @param <T> One of the Mdr?Record types that need to be sorted on a text field, eg street name.
@@ -94,13 +93,8 @@
 	 * by calling getObject().
 	 */
 	public static <T extends NamedRecord> List<SortKey<T>> sortList(Sort sort, List<T> list) {
-		List<SortKey<T>> toSort = new ArrayList<SortKey<T>>(list.size());
-		for (T m : list) {
-			SortKey<T> sortKey = sort.createSortKey(m, m.getName(), m.getMapIndex());
-			toSort.add(sortKey);
-		}
-		Collections.sort(toSort);
-		return toSort;
+		return list.stream().map(m -> sort.createSortKey(m, m.getName(), m.getMapIndex())).sorted()
+				.collect(Collectors.toList());
 	}
 
 	/**
Index: src/uk/me/parabola/imgfmt/app/net/AngleChecker.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/net/AngleChecker.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/net/AngleChecker.java	(working copy)
@@ -13,8 +13,6 @@
 package uk.me.parabola.imgfmt.app.net;
 
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -150,15 +148,7 @@
 		if (n <= 1)
 			return;
 		// sort the arcs by initial heading 
-		Collections.sort(arcGroups, new Comparator<ArcGroup>() {
-				public int compare(ArcGroup ag1, ArcGroup ag2) {
-					if (ag1.initialHeading < ag2.initialHeading)
-						return -1;
-					if (ag1.initialHeading > ag2.initialHeading)
-						return 1;
-					return 0;
-				}
-			});
+		arcGroups.sort((ag1, ag2) -> Float.compare(ag1.initialHeading, ag2.initialHeading));
 		
 		class AngleAttr {
 			int angle;
@@ -360,22 +350,19 @@
 			return arcGroups; // should not happen
 		
 		// sort the arcs by initial heading 
-		Collections.sort(directArcs, new Comparator<RouteArc>() {
-				public int compare(RouteArc ra1, RouteArc ra2) {
-					if (ra1.getInitialHeading() < ra2.getInitialHeading())
-						return -1;
-					if (ra1.getInitialHeading() > ra2.getInitialHeading())
-						return 1;
-					int d = Integer.compare(ra1.getPointsHash(), ra2.getPointsHash());
-					if (d != 0)
-						return d;
-					d = Long.compare(ra1.getRoadDef().getId() , ra2.getRoadDef().getId());
-					if (d != 0)
-						return d;
-					return d;
-				}
-			});
-		
+		directArcs.sort((ra1,ra2) -> {
+			int d = Float.compare(ra1.getInitialHeading(), ra2.getInitialHeading());
+			if (d != 0)
+				return d;
+			d = Integer.compare(ra1.getPointsHash(), ra2.getPointsHash());
+			if (d != 0)
+				return d;
+			d = Long.compare(ra1.getRoadDef().getId() , ra2.getRoadDef().getId());
+			if (d != 0)
+				return d;
+			return d;
+		});
+
 		Iterator<RouteArc> iter = directArcs.listIterator();
 		RouteArc arc1 = iter.next();
 		boolean addArc1 = false;
Index: src/uk/me/parabola/imgfmt/app/net/NETFile.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/net/NETFile.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/net/NETFile.java	(working copy)
@@ -17,8 +17,6 @@
 package uk.me.parabola.imgfmt.app.net;
 
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -126,7 +124,7 @@
 
 				// Sort by name, city, region/country and subdivision number.
 				LabeledRoadDef lrd = new LabeledRoadDef(label, rd);
-				SortKey<LabeledRoadDef> nameKey = new IntegerSortKey<NETFile.LabeledRoadDef>(lrd, label.getOffset(), 0);
+				SortKey<LabeledRoadDef> nameKey = new IntegerSortKey<>(lrd, label.getOffset(), 0);
 				// If there is a city add it to the sort.
 				City city = (rd.getCities().isEmpty() ? null : rd.getCities().get(0)); // what if we more than one?
 				SortKey<LabeledRoadDef> cityKey;
@@ -145,7 +143,7 @@
 			}
 		}
 
-		Collections.sort(sortKeys);
+		sortKeys.sort(null);
 
 		List<LabeledRoadDef> out = new ArrayList<>(sortKeys.size());
 
@@ -194,7 +192,7 @@
 			SortKey<LabeledRoadDef> sk2 = sort.createSortKey(null, lrd.label, 0, cacheFull);
 			sortKeys.add(new DoubleSortKey<>(sk1, sk2));
 		}
-		Collections.sort(sortKeys);
+		sortKeys.sort(null);
 		roads.clear();
 		for (SortKey<LabeledRoadDef> key : sortKeys) {
 			roads.add(key.getObject());
@@ -279,13 +277,7 @@
 	 * @param out List to add the discovered groups.
 	 */
 	private void addDisconnectedLarge(List<LabeledRoadDef> in, List<LabeledRoadDef> out) {
-		Collections.sort(in, new Comparator<LabeledRoadDef>() {
-			public int compare(LabeledRoadDef o1, LabeledRoadDef o2) {
-				int i1 = o1.roadDef.getStartSubdivNumber();
-				int i2 = o2.roadDef.getStartSubdivNumber();
-				return Integer.compare(i1, i2);
-			}
-		});
+		in.sort((o1, o2) -> Integer.compare(o1.roadDef.getStartSubdivNumber(), o2.roadDef.getStartSubdivNumber()));
 
 		int lastDiv = 0;
 		List<LabeledRoadDef> dupes = new ArrayList<>();
Index: src/uk/me/parabola/imgfmt/app/net/NETFileReader.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/net/NETFileReader.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/net/NETFileReader.java	(working copy)
@@ -12,10 +12,7 @@
  */
 package uk.me.parabola.imgfmt.app.net;
 
-import it.unimi.dsi.fastutil.ints.IntArrayList;
-
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -22,6 +19,7 @@
 import java.util.Map;
 import java.util.Set;
 
+import it.unimi.dsi.fastutil.ints.IntArrayList;
 import uk.me.parabola.imgfmt.Utils;
 import uk.me.parabola.imgfmt.app.BufferedImgFileReader;
 import uk.me.parabola.imgfmt.app.ImgFile;
@@ -287,7 +285,7 @@
 		// Sort in address order in the hope of speeding up reading.
 		List<Integer> offsets = new ArrayList<>(allOffsets);
 		allOffsets = null;
-		Collections.sort(offsets);
+		offsets.sort(null);
 		return offsets;
 	}
 
Index: src/uk/me/parabola/imgfmt/app/net/NOD1Part.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/net/NOD1Part.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/net/NOD1Part.java	(working copy)
@@ -17,8 +17,6 @@
 package uk.me.parabola.imgfmt.app.net;
 
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
 import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.List;
@@ -329,11 +327,7 @@
 	 * be a legal RouteCenter.
 	 */
 	private RouteCenter toRouteCenter() {
-		Collections.sort(nodes, new Comparator<RouteNode>() {
-			public int compare(RouteNode n1, RouteNode n2) {
-				return n1.getCoord().compareTo(n2.getCoord());
-			}
-		});
+		nodes.sort((n1, n2) -> n1.getCoord().compareTo(n2.getCoord()));
 		TableB tabB = new TableB();
 		for (RouteNode rn : destNodes.keySet())
 			tabB.addNode(rn);
Index: src/uk/me/parabola/imgfmt/app/net/NODFile.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/net/NODFile.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/net/NODFile.java	(working copy)
@@ -17,7 +17,6 @@
 package uk.me.parabola.imgfmt.app.net;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import uk.me.parabola.imgfmt.app.BufferedImgFileReader;
@@ -135,7 +134,7 @@
 	private void writeBoundary() {
 		log.info("writeBoundary");
 
-		Collections.sort(boundary);
+		boundary.sort(null);
 
 		ImgFileWriter writer = new SectionWriter(getWriter(), nodHeader.getBoundarySection());
 
@@ -157,8 +156,6 @@
 	private void writeHighClassBoundary() {
 		log.info("writeBoundary");
 
-//		Collections.sort(boundary); // already sorted for NOD3
-
 		Section section = nodHeader.getHighClassBoundary();
 		int pos = section.getPosition();
 		pos = (pos + 0x200) & ~0x1ff; // align on 0x200  
Index: src/uk/me/parabola/imgfmt/app/net/RoadDef.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/net/RoadDef.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/net/RoadDef.java	(working copy)
@@ -29,7 +29,6 @@
 import uk.me.parabola.imgfmt.MapFailedException;
 import uk.me.parabola.imgfmt.Utils;
 import uk.me.parabola.imgfmt.app.BitWriter;
-import uk.me.parabola.imgfmt.app.Coord;
 import uk.me.parabola.imgfmt.app.ImgFileWriter;
 import uk.me.parabola.imgfmt.app.Label;
 import uk.me.parabola.imgfmt.app.lbl.City;
Index: src/uk/me/parabola/imgfmt/app/trergn/ExtTypeAttributes.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/trergn/ExtTypeAttributes.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/trergn/ExtTypeAttributes.java	(working copy)
@@ -19,7 +19,6 @@
 import java.text.DecimalFormat;
 import java.text.ParsePosition;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
@@ -411,7 +410,7 @@
 					break;
 			}
 			// sort the lights by increasing sector start angle
-			Collections.sort(lights);
+			lights.sort(null);
 			// generate the descriptor string - each light is
 			// specified as color,range,sectorStartAngle
 			String light = null;
Index: src/uk/me/parabola/imgfmt/app/trergn/TREFile.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/trergn/TREFile.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/trergn/TREFile.java	(working copy)
@@ -17,7 +17,6 @@
 package uk.me.parabola.imgfmt.app.trergn;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
@@ -226,7 +225,7 @@
 		header.setPointPos(position());
 		
 		// Point overview section
-		Collections.sort(pointOverviews);
+		pointOverviews.sort(null);
 		for (Overview ov : pointOverviews) {
 			if(!ov.hasExtType()) {
 				ov.setMaxLevel(decodeLevel(ov.getMinResolution()));
@@ -237,7 +236,7 @@
 
 		// Line overview section.
 		header.setPolylinePos(position());
-		Collections.sort(polylineOverviews);
+		polylineOverviews.sort(null);
 		for (Overview ov : polylineOverviews) {
 			if(!ov.hasExtType()) {
 				ov.setMaxLevel(decodeLevel(ov.getMinResolution()));
@@ -248,7 +247,7 @@
 
 		// Polygon overview section
 		header.setPolygonPos(position());
-		Collections.sort(polygonOverviews);
+		polygonOverviews.sort(null);
 		for (Overview ov : polygonOverviews) {
 			if(!ov.hasExtType()) {
 				ov.setMaxLevel(decodeLevel(ov.getMinResolution()));
Index: src/uk/me/parabola/imgfmt/app/typ/TYPFile.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/typ/TYPFile.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/app/typ/TYPFile.java	(working copy)
@@ -22,7 +22,6 @@
 import java.nio.charset.CharacterCodingException;
 import java.nio.charset.CharsetEncoder;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
@@ -101,7 +100,7 @@
 				keys.add(key);
 			}
 		}
-		Collections.sort(keys);
+		keys.sort(null);
 
 		// Offset 0 is reserved to mean no label.
 		writer.put1u(0);
@@ -160,7 +159,7 @@
 	private void writeSection(ImgFileWriter writer, Section dataSection, Section indexSection,
 			List<? extends TypElement> elementData)
 	{
-		Collections.sort(elementData);
+		elementData.sort(null);
 
 		SectionWriter subWriter = dataSection.makeSectionWriter(writer);
 		CharsetEncoder encoder = data.getEncoder();
Index: src/uk/me/parabola/imgfmt/mdxfmt/MdxFile.java
===================================================================
--- src/uk/me/parabola/imgfmt/mdxfmt/MdxFile.java	(revision 4315)
+++ src/uk/me/parabola/imgfmt/mdxfmt/MdxFile.java	(working copy)
@@ -21,8 +21,6 @@
 import java.nio.channels.FileChannel;
 import java.nio.channels.WritableByteChannel;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
 
 /**
@@ -37,7 +35,7 @@
 	private final char familyId;
 	private final char productId;
 	
-	private final List<MapInfo> maps = new ArrayList<MapInfo>();
+	private final List<MapInfo> maps = new ArrayList<>();
 
 	/**
 	 * Create with default family and product ids.
@@ -99,16 +97,7 @@
 
 	private void writeBody(WritableByteChannel chan, ByteBuffer buf) throws IOException {
 		// Sort the maps by the hex number.
-		Collections.sort(maps, new Comparator<MapInfo>() {
-			public int compare(MapInfo o1, MapInfo o2) {
-				if (o1.getHexMapname() == o2.getHexMapname())
-					return 0;
-				else if (o1.getHexMapname() < o2.getHexMapname())
-					return -1;
-				else
-					return 1;
-			}
-		});
+		maps.sort((o1, o2) -> Integer.compare(o1.getHexMapname(), o2.getHexMapname()));
 
 		for (MapInfo info : maps) {
 			// Although its not necessarily wrong for them to be zero, it probably
Index: src/uk/me/parabola/mkgmap/build/MapBuilder.java
===================================================================
--- src/uk/me/parabola/mkgmap/build/MapBuilder.java	(revision 4315)
+++ src/uk/me/parabola/mkgmap/build/MapBuilder.java	(working copy)
@@ -24,7 +24,6 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashMap;
 import java.util.IdentityHashMap;
 import java.util.List;
@@ -31,6 +30,7 @@
 import java.util.Set;
 import java.util.function.UnaryOperator;
 
+import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
 import uk.me.parabola.imgfmt.ExitException;
 import uk.me.parabola.imgfmt.MapFailedException;
 import uk.me.parabola.imgfmt.Utils;
@@ -104,7 +104,6 @@
 import uk.me.parabola.util.Configurable;
 import uk.me.parabola.util.EnhancedProperties;
 import uk.me.parabola.util.Java2DConverter;
-import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
 
 /**
  * This is the core of the code to translate from the general representation
@@ -1226,11 +1225,7 @@
 		
 		if (orderByDecreasingArea && shapes.size() > 1) {
 			// sort so that the shape with the largest area is processed first
-			Collections.sort(shapes, new Comparator<MapShape>() {
-				public int compare(MapShape s1, MapShape s2) {
-					return Long.compare(Math.abs(s2.getFullArea()), Math.abs(s1.getFullArea()));
-				}
-			});
+			shapes.sort((s1,s2) -> Long.compare(Math.abs(s2.getFullArea()), Math.abs(s1.getFullArea())));
 		}
 
 		preserveHorizontalAndVerticalLines(res, shapes);
Index: src/uk/me/parabola/mkgmap/main/Main.java
===================================================================
--- src/uk/me/parabola/mkgmap/main/Main.java	(revision 4315)
+++ src/uk/me/parabola/mkgmap/main/Main.java	(working copy)
@@ -28,7 +28,6 @@
 import java.time.Instant;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Comparator;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -604,8 +603,7 @@
 		for (Combiner c : combiners)
 			c.init(args);
 
-		filenames.sort(new Comparator<FilenameTask>() {
-			public int compare(FilenameTask o1, FilenameTask o2) {
+		filenames.sort((o1, o2) -> {
 				if (!o1.getFilename().endsWith(".img") || !o2.getFilename().endsWith(".img"))
 					return o1.getFilename().compareTo(o2.getFilename());
 
@@ -622,8 +620,6 @@
 				} catch (FileNotFoundException ignored) {
 				}
 				return 0;
-			}
-
 		});
 
 		// will contain img files for which an additional ovm file was found
Index: src/uk/me/parabola/mkgmap/osmstyle/PrefixSuffixFilter.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/PrefixSuffixFilter.java	(revision 4315)
+++ src/uk/me/parabola/mkgmap/osmstyle/PrefixSuffixFilter.java	(working copy)
@@ -19,7 +19,6 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashSet;
@@ -314,11 +313,6 @@
 	 * @param strings
 	 */
 	private void sortByLength(List<String> strings) {
-		strings.sort(new Comparator<String>() {
-			@Override
-			public int compare(String o1, String o2) {
-				return Integer.compare(o2.length(), o1.length());
-			}
-		});
+		strings.sort((o1, o2) -> Integer.compare(o2.length(), o1.length()));
 	}
 }
Index: src/uk/me/parabola/mkgmap/osmstyle/housenumber/ExtNumbers.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/housenumber/ExtNumbers.java	(revision 4315)
+++ src/uk/me/parabola/mkgmap/osmstyle/housenumber/ExtNumbers.java	(working copy)
@@ -557,7 +557,7 @@
 		List<HousenumberMatch> testOrder = new ArrayList<>(); 
 		testOrder.add(house1);
 		testOrder.add(house2);
-		Collections.sort(testOrder, new HousenumberMatchByPosComparator());
+		testOrder.sort(new HousenumberMatchByPosComparator());
 		if (testOrder.get(0) != house1){
 			log.info("order indicates random case or missing road!",this);
 			housenumberRoad.setRandom(true);
@@ -1054,7 +1054,7 @@
 			HousenumberGenerator.findClosestRoadSegment(house, getRoad(), startInRoad, endInRoad);
 		}
 		if (houses.size() > 1)
-			Collections.sort(houses, new HousenumberMatchByPosComparator());
+			houses.sort(new HousenumberMatchByPosComparator());
 	}
 	
 	
@@ -1457,7 +1457,7 @@
 							from.housenumberRoad.getHouses().remove(bestMoveOrig);
 							fromHouses.remove(bestMoveOrig);
 							toHouses.add(bestMoveOrig);
-							Collections.sort(toHouses, new HousenumberMatchByPosComparator());
+							toHouses.sort(new HousenumberMatchByPosComparator());
 							en1.reset();
 							en2.reset();
 							en1.setNumbers(houses1, en1.startInRoad, en1.endInRoad, left1);
Index: src/uk/me/parabola/mkgmap/osmstyle/housenumber/HousenumberGenerator.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/housenumber/HousenumberGenerator.java	(revision 4315)
+++ src/uk/me/parabola/mkgmap/osmstyle/housenumber/HousenumberGenerator.java	(working copy)
@@ -826,7 +826,7 @@
 		for (Entry<CityInfo, MultiHashMap<String, HousenumberMatch>> topEntry : cityPlaceHouseMap.entrySet()){
 			CityInfo cityInfo = topEntry.getKey();
 			List<String> placeNames = new ArrayList<>(topEntry.getValue().keySet());
-			Collections.sort(placeNames);
+			placeNames.sort(null);
 			for (String placeName : placeNames){
 				List<HousenumberMatch> placeHouses = topEntry.getValue().get(placeName);
 				HashSet<HousenumberRoad> roads = new LinkedHashSet<>();
@@ -1233,7 +1233,7 @@
 			List<HousenumberRoad> roadsInCluster) {
 		if (houses.isEmpty())
 			return;
-		Collections.sort(houses, new HousenumberMatchByNumComparator());
+		houses.sort(new HousenumberMatchByNumComparator());
 		
 		HousenumberMatch prev = null;
 		for (HousenumberMatch house : houses) {
@@ -1268,7 +1268,7 @@
 				// multiple roads, we assume that the closest is the best
 				// but we may have to check the alternatives as well
 				
-				Collections.sort(matches, new HousenumberGenerator.HousenumberMatchByDistComparator());
+				matches.sort(new HousenumberGenerator.HousenumberMatchByDistComparator());
 				closest  = matches.get(0);
 				best = checkAngle(closest, matches);	
 			}
@@ -1307,7 +1307,7 @@
 	
 	private static void markSimpleDuplicates(String streetName, List<HousenumberMatch> housesNearCluster) {
 		List<HousenumberMatch> sortedHouses = new ArrayList<>(housesNearCluster);
-		Collections.sort(sortedHouses, new HousenumberMatchByNumComparator());
+		sortedHouses.sort(new HousenumberMatchByNumComparator());
 		int n = sortedHouses.size();
 		for (int i = 1; i < n; i++){
 			HousenumberMatch house1 = sortedHouses.get(i-1);
@@ -1802,9 +1802,7 @@
 			List<RoadPoint> closeRoadPoints = getCLoseRoadPoints(house);
 			if (closeRoadPoints.isEmpty())
 				return closest;
-			Collections.sort(closeRoadPoints, new Comparator<RoadPoint>() {
-				// sort by distance (smallest first)
-				public int compare(RoadPoint o1,  RoadPoint o2) {
+			closeRoadPoints.sort((o1,o2)-> {
 					if (o1 == o2)
 						return 0;
 					int d = Integer.compare(o1.r.getRoadId(), o2.r.getRoadId());
@@ -1815,7 +1813,7 @@
 						return d; 
 					return Integer.compare(o1.partOfSeg, o2.partOfSeg);
 				}
-			});
+			);
 
 			List<HousenumberMatch> matches = new ArrayList<>(40);
 			BitSet testedSegments = new BitSet();
@@ -1856,7 +1854,7 @@
 			if (matches.isEmpty())
 				return closest; // closest has not yet a road
 			
-			Collections.sort(matches, new HousenumberGenerator.HousenumberMatchByDistComparator());
+			matches.sort(new HousenumberGenerator.HousenumberMatchByDistComparator());
 			closest = matches.get(0);
 			closest = checkAngle(closest, matches);
 			closest.calcRoadSide();
Index: src/uk/me/parabola/mkgmap/osmstyle/housenumber/HousenumberRoad.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/housenumber/HousenumberRoad.java	(revision 4315)
+++ src/uk/me/parabola/mkgmap/osmstyle/housenumber/HousenumberRoad.java	(working copy)
@@ -77,7 +77,7 @@
 	}
 	
 	public void buildIntervals() {
-		Collections.sort(houseNumbers, new HousenumberMatchByNumComparator());
+		houseNumbers.sort(new HousenumberMatchByNumComparator());
 		if (log.isInfoEnabled())
 			log.info("Initial housenumbers for",road,"in",road.getCity(),houseNumbers);
 		
@@ -102,8 +102,8 @@
 			}
 		}
 		detectGroups(leftNumbers, rightNumbers);
-		Collections.sort(leftNumbers, new HousenumberMatchByPosComparator());
-		Collections.sort(rightNumbers, new HousenumberMatchByPosComparator());
+		leftNumbers.sort(new HousenumberMatchByPosComparator());
+		rightNumbers.sort(new HousenumberMatchByPosComparator());
 		
 		
 		int currNodePos = 0;
Index: src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonCutter.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonCutter.java	(revision 4315)
+++ src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonCutter.java	(working copy)
@@ -293,7 +293,7 @@
 			CutPoint edgeCutPoint = new CutPoint(axis, outerBounds);
 
 			// go through the inner polygon list and use all polygons that intersect the outer polygons bbox at the start
-			Collections.sort(innerStart, (axis == CoordinateAxis.LONGITUDE ? COMP_LONG_START: COMP_LAT_START));
+			innerStart.sort(axis == CoordinateAxis.LONGITUDE ? COMP_LONG_START: COMP_LAT_START);
 			for (Area anInnerStart : innerStart) {
 				if (axis.getStartHighPrec(anInnerStart) <= axis.getStartHighPrec(outerBounds)) {
 					// found a touching area
@@ -307,7 +307,7 @@
 				return edgeCutPoint;
 			}
 			
-			Collections.sort(innerStart, (axis == CoordinateAxis.LONGITUDE ? COMP_LONG_STOP: COMP_LAT_STOP));
+			innerStart.sort(axis == CoordinateAxis.LONGITUDE ? COMP_LONG_STOP: COMP_LAT_STOP);
 			// go through the inner polygon list and use all polygons that intersect the outer polygons bbox at the stop
 			for (Area anInnerStart : innerStart) {
 				if (axis.getStopHighPrec(anInnerStart) >= axis.getStopHighPrec(outerBounds)) {
@@ -329,7 +329,7 @@
 			CutPoint bestCutPoint = new CutPoint(axis, outerBounds);
 			CutPoint currentCutPoint = new CutPoint(axis, outerBounds);
 
-			Collections.sort(innerStart, (axis == CoordinateAxis.LONGITUDE ? COMP_LONG_START: COMP_LAT_START));
+			innerStart.sort(axis == CoordinateAxis.LONGITUDE ? COMP_LONG_START: COMP_LAT_START);
 
 			for (Area anInnerStart : innerStart) {
 				currentCutPoint.addArea(anInnerStart);
@@ -551,7 +551,7 @@
 			}
 
 			areas.add(area);
-			Collections.sort(areas, comparator);
+			areas.sort(comparator);
 			startPoinHp = axis.getStartHighPrec(Collections.max(areas,
 				(axis == CoordinateAxis.LONGITUDE ? COMP_LONG_START
 						: COMP_LAT_START)));
Index: src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java	(revision 4315)
+++ src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java	(working copy)
@@ -547,12 +547,7 @@
 			} else {
 				// retrieve the connection with the minimum distance
 				ConnectionData minCon = Collections.min(coordPairs,
-						new Comparator<ConnectionData>() {
-							public int compare(ConnectionData o1,
-									ConnectionData o2) {
-								return Double.compare(o1.distance, o2.distance);
-							}
-						});
+						(o1, o2) -> Double.compare(o1.distance, o2.distance));
 
 				if (minCon.w1 == minCon.w2) {
 					log.debug("Close a gap in way",minCon.w1);
@@ -726,12 +721,10 @@
 		// sort by role and then by number of points, this improves performance
 		// in the routines which add the polygons to areas
 		if (polygonStatusList.size() > 2){
-			Collections.sort(polygonStatusList, new Comparator<PolygonStatus>() {
-				public int compare(PolygonStatus o1, PolygonStatus o2) {
-					if (o1.outer != o2.outer)
-						return (o1.outer) ? -1 : 1;
-					return o1.polygon.getPoints().size() - o2.polygon.getPoints().size();
-				}
+			polygonStatusList.sort((o1, o2) -> {
+				if (o1.outer != o2.outer)
+					return (o1.outer) ? -1 : 1;
+				return o1.polygon.getPoints().size() - o2.polygon.getPoints().size();
 			});
 		}
 		return polygonStatusList;
Index: src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryDiff.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryDiff.java	(revision 4315)
+++ src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryDiff.java	(working copy)
@@ -81,8 +81,8 @@
 		if (b1.size() == 0 && b2.size() == 0)
 			return;
 		
-		Collections.sort(b1);
-		Collections.sort(b2);
+		b1.sort(null);
+		b2.sort(null);
 
 		Queue<String> bounds1 = new LinkedList<>(b1);
 		Queue<String> bounds2 = new LinkedList<>(b2);
Index: src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryMerger.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryMerger.java	(revision 4315)
+++ src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryMerger.java	(working copy)
@@ -18,7 +18,6 @@
 import java.io.IOException;
 import java.nio.channels.FileChannel;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.ListIterator;
 
@@ -54,8 +53,8 @@
 		List<String> fl1 = BoundaryUtil.getBoundaryDirContent(dir1.getAbsolutePath());
 		List<String> fl2 = BoundaryUtil.getBoundaryDirContent(dir2.getAbsolutePath());
 		
-		Collections.sort(fl1);
-		Collections.sort(fl2);
+		fl1.sort(null);
+		fl2.sort(null);
 		
 		ListIterator<String> fl1Iter = fl1.listIterator();
 		ListIterator<String> fl2Iter = fl2.listIterator();
Index: src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryQuadTree.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryQuadTree.java	(revision 4315)
+++ src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryQuadTree.java	(working copy)
@@ -271,7 +271,7 @@
 	private void sortBoundaryTagsMap(){
 		// make sure that the merged LinkedHashMap is sorted as mergeBoundaries() needs it
 		ArrayList<String> ids = new ArrayList<>(boundaryTags.keySet());
-		Collections.sort(ids, new AdminLevelCollator());
+		ids.sort(new AdminLevelCollator());
 		Collections.reverse(ids);
 		HashMap<String,Tags> tmp = new LinkedHashMap<>(boundaryTags);
 		boundaryTags.clear();
Index: src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryRelation.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryRelation.java	(revision 4315)
+++ src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryRelation.java	(working copy)
@@ -15,7 +15,6 @@
 import java.util.ArrayList;
 import java.util.BitSet;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.IdentityHashMap;
@@ -356,12 +355,7 @@
 			} else {
 				// retrieve the connection with the minimum distance
 				ConnectionData minCon = Collections.min(coordPairs,
-						new Comparator<ConnectionData>() {
-							public int compare(ConnectionData o1,
-									ConnectionData o2) {
-								return Double.compare(o1.distance, o2.distance);
-							}
-						});
+						(o1, o2) -> Double.compare(o1.distance, o2.distance));
 				
 				if (minCon.distance < getMaxCloseDist()) {
 
Index: src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundarySaver.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundarySaver.java	(revision 4315)
+++ src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundarySaver.java	(working copy)
@@ -12,7 +12,6 @@
  */
 package uk.me.parabola.mkgmap.reader.osm.boundary;
 
-import it.unimi.dsi.fastutil.ints.IntArrayList;
 import java.awt.Shape;
 import java.awt.geom.PathIterator;
 import java.io.BufferedOutputStream;
@@ -23,8 +22,6 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -33,6 +30,7 @@
 import java.util.Map.Entry;
 import java.util.regex.Pattern;
 
+import it.unimi.dsi.fastutil.ints.IntArrayList;
 import uk.me.parabola.log.Logger;
 import uk.me.parabola.mkgmap.Version;
 import uk.me.parabola.mkgmap.reader.osm.Tags;
@@ -177,13 +175,8 @@
 			return;
 		}
 
-		Collections.sort(openStreams, new Comparator<StreamInfo>() {
+		openStreams.sort((o1, o2) -> o1.lastAccessNo - o2.lastAccessNo);
 
-			public int compare(StreamInfo o1, StreamInfo o2) {
-				return o1.lastAccessNo - o2.lastAccessNo;
-			}
-		});
-
 		log.debug(openStreams.size(), "open streams.");
 		List<StreamInfo> closingStreams = openStreams.subList(0,
 				openStreams.size() - 80);
Index: test/main/SortTest.java
===================================================================
--- test/main/SortTest.java	(revision 4315)
+++ test/main/SortTest.java	(working copy)
@@ -174,7 +174,7 @@
 			SortKey<String> key = sort.createSortKey(s, s);
 			keys.add(key);
 		}
-		Collections.sort(keys);
+		keys.sort(null);
 
 		long end = System.currentTimeMillis();
 
@@ -190,7 +190,7 @@
 	private List<String> sortWithCollator(List<String> list) {
 		long start = System.currentTimeMillis();
 		List<String> ret = new ArrayList<>(list);
-		Collections.sort(ret, sort.getCollator());
+		ret.sort(sort.getCollator());
 		System.out.println("time coll: " + (System.currentTimeMillis() - start) + "ms");
 		return ret;
 	}
@@ -210,7 +210,7 @@
 			CollationKey key = jcol.getCollationKey(s);
 			keys.add(key);
 		}
-		Collections.sort(keys);
+		keys.sort(null);
 
 		long end = System.currentTimeMillis();
 
@@ -236,7 +236,7 @@
 			return null;
 		}
 
-		Collections.sort(out, jcol);
+		out.sort(jcol);
 
 		System.out.println("time J collator: " + (System.currentTimeMillis() - start) + "ms");
 		return out;
Index: test/uk/me/parabola/mkgmap/reader/osm/ElementTest.java
===================================================================
--- test/uk/me/parabola/mkgmap/reader/osm/ElementTest.java	(revision 4315)
+++ test/uk/me/parabola/mkgmap/reader/osm/ElementTest.java	(working copy)
@@ -16,16 +16,16 @@
  */
 package uk.me.parabola.mkgmap.reader.osm;
 
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
 import org.junit.Test;
 
-import static org.junit.Assert.*;
 
-
 public class ElementTest {
 	@Test
 	public void testEntryIterator() {
@@ -43,8 +43,8 @@
 			values.add(ent.getValue());
 		}
 
-		Collections.sort(keys);
-		Collections.sort(values);
+		keys.sort(null);
+		values.sort(null);
 
 		assertArrayEquals("list of keys",
 				new String[] {"a", "b", "c"},
