Index: /trunk/src/org/openstreetmap/josm/data/imagery/WMSEndpointTileSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/WMSEndpointTileSource.java	(revision 16055)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/WMSEndpointTileSource.java	(revision 16056)
@@ -41,5 +41,5 @@
     public WMSEndpointTileSource(ImageryInfo info, Projection tileProjection) {
         super(info, tileProjection);
-        CheckParameterUtil.ensure(info, "imageryType", x -> ImageryType.WMS_ENDPOINT == x.getImageryType());
+        CheckParameterUtil.ensureThat(info.getImageryType() == ImageryType.WMS_ENDPOINT, "imageryType");
         try {
             wmsi = new WMSImagery(info.getUrl(), info.getCustomHttpHeaders());
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java	(revision 16055)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java	(revision 16056)
@@ -76,5 +76,5 @@
     public ParentRelationLoadingTask(Relation child, OsmDataLayer layer, boolean full, PleaseWaitProgressMonitor monitor) {
         super(tr("Download referring relations"), monitor, false /* don't ignore exception */);
-        CheckParameterUtil.ensure(child, "child", "id > 0", ch -> ch.getUniqueId() > 0);
+        CheckParameterUtil.ensureThat(child.getUniqueId() > 0, "id > 0");
         CheckParameterUtil.ensureParameterNotNull(layer, "layer");
         if (!layer.isDownloadable()) {
Index: /trunk/src/org/openstreetmap/josm/gui/history/HistoryLoadTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/history/HistoryLoadTask.java	(revision 16055)
+++ /trunk/src/org/openstreetmap/josm/gui/history/HistoryLoadTask.java	(revision 16056)
@@ -82,5 +82,5 @@
      */
     public HistoryLoadTask add(PrimitiveId pid) {
-        CheckParameterUtil.ensure(pid, "pid", "pid > 0", id -> id.getUniqueId() > 0);
+        CheckParameterUtil.ensureThat(pid.getUniqueId() > 0, "id > 0");
         toLoad.add(pid);
         return this;
@@ -120,5 +120,5 @@
      */
     public HistoryLoadTask add(OsmPrimitive primitive) {
-        CheckParameterUtil.ensure(primitive, "primitive", "id > 0", prim -> prim.getOsmId() > 0);
+        CheckParameterUtil.ensureThat(primitive.getOsmId() > 0, "id > 0");
         return add(primitive.getOsmPrimitiveId());
     }
Index: /trunk/src/org/openstreetmap/josm/gui/layer/imagery/TileSourceDisplaySettings.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/imagery/TileSourceDisplaySettings.java	(revision 16055)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/imagery/TileSourceDisplaySettings.java	(revision 16056)
@@ -245,5 +245,5 @@
 
     private void setDisplacement(EastNorth displacement) {
-        CheckParameterUtil.ensure(displacement, "displacement", EastNorth::isValid);
+        CheckParameterUtil.ensureThat(displacement.isValid(), () -> displacement + " invalid");
         this.displacement = displacement;
         fireSettingsChange(DISPLACEMENT);
Index: /trunk/src/org/openstreetmap/josm/io/OsmServerBackreferenceReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmServerBackreferenceReader.java	(revision 16055)
+++ /trunk/src/org/openstreetmap/josm/io/OsmServerBackreferenceReader.java	(revision 16056)
@@ -54,5 +54,5 @@
      */
     public OsmServerBackreferenceReader(OsmPrimitive primitive) {
-        CheckParameterUtil.ensure(primitive, "primitive", "id > 0", prim -> prim.getUniqueId() > 0);
+        CheckParameterUtil.ensureThat(primitive.getUniqueId() > 0, "id > 0");
         this.id = primitive.getId();
         this.primitiveType = OsmPrimitiveType.from(primitive);
Index: /trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java	(revision 16055)
+++ /trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java	(revision 16056)
@@ -96,5 +96,5 @@
 
     protected OsmServerObjectReader(PrimitiveId id, boolean full, int version) {
-        CheckParameterUtil.ensure(id, "id", "id > 0", pid -> pid.getUniqueId() > 0);
+        CheckParameterUtil.ensureThat(id.getUniqueId() > 0, "id > 0");
         this.id = id;
         this.full = full;
Index: /trunk/src/org/openstreetmap/josm/tools/CheckParameterUtil.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/CheckParameterUtil.java	(revision 16055)
+++ /trunk/src/org/openstreetmap/josm/tools/CheckParameterUtil.java	(revision 16056)
@@ -3,5 +3,4 @@
 
 import java.text.MessageFormat;
-import java.util.function.Predicate;
 import java.util.function.Supplier;
 
@@ -15,46 +14,4 @@
     private CheckParameterUtil() {
         // Hide default constructor for utils classes
-    }
-
-    /**
-     * Ensures that a parameter is not null and that a certain condition holds.
-     * @param <T> parameter type
-     * @param obj parameter value
-     * @param parameterName parameter name
-     * @param conditionMsg string, stating the condition
-     * @param condition the condition to check
-     * @throws IllegalArgumentException in case the object is null or the condition
-     * is violated
-     * @since 12713
-     */
-    public static <T> void ensure(T obj, String parameterName, String conditionMsg, Predicate<T> condition) {
-        ensureParameterNotNull(obj, parameterName);
-        if (!condition.test(obj))
-            throw new IllegalArgumentException(
-                    MessageFormat.format("Parameter value ''{0}'' of type {1} is invalid, violated condition: ''{2}'', got ''{3}''",
-                            parameterName,
-                            obj.getClass().getCanonicalName(),
-                            conditionMsg,
-                            obj));
-    }
-
-    /**
-     * Ensures that a parameter is not null and that a certain condition holds.
-     * @param <T> parameter type
-     * @param obj parameter value
-     * @param parameterName parameter name
-     * @param condition the condition to check
-     * @throws IllegalArgumentException in case the object is null or the condition
-     * is violated
-     * @since 12713
-     */
-    public static <T> void ensure(T obj, String parameterName, Predicate<T> condition) {
-        ensureParameterNotNull(obj, parameterName);
-        if (!condition.test(obj))
-            throw new IllegalArgumentException(
-                    MessageFormat.format("Parameter value ''{0}'' of type {1} is invalid, got ''{2}''",
-                            parameterName,
-                            obj.getClass().getCanonicalName(),
-                            obj));
     }
 
Index: /trunk/src/org/openstreetmap/josm/tools/Geometry.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 16055)
+++ /trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 16056)
@@ -294,8 +294,8 @@
     public static EastNorth getSegmentSegmentIntersection(EastNorth p1, EastNorth p2, EastNorth p3, EastNorth p4) {
 
-        CheckParameterUtil.ensure(p1, "p1", EastNorth::isValid);
-        CheckParameterUtil.ensure(p2, "p2", EastNorth::isValid);
-        CheckParameterUtil.ensure(p3, "p3", EastNorth::isValid);
-        CheckParameterUtil.ensure(p4, "p4", EastNorth::isValid);
+        CheckParameterUtil.ensureThat(p1.isValid(), () -> p1 + " invalid");
+        CheckParameterUtil.ensureThat(p2.isValid(), () -> p2 + " invalid");
+        CheckParameterUtil.ensureThat(p3.isValid(), () -> p3 + " invalid");
+        CheckParameterUtil.ensureThat(p4.isValid(), () -> p4 + " invalid");
 
         double x1 = p1.getX();
@@ -359,8 +359,8 @@
     public static EastNorth getLineLineIntersection(EastNorth p1, EastNorth p2, EastNorth p3, EastNorth p4) {
 
-        CheckParameterUtil.ensure(p1, "p1", EastNorth::isValid);
-        CheckParameterUtil.ensure(p2, "p2", EastNorth::isValid);
-        CheckParameterUtil.ensure(p3, "p3", EastNorth::isValid);
-        CheckParameterUtil.ensure(p4, "p4", EastNorth::isValid);
+        CheckParameterUtil.ensureThat(p1.isValid(), () -> p1 + " invalid");
+        CheckParameterUtil.ensureThat(p2.isValid(), () -> p2 + " invalid");
+        CheckParameterUtil.ensureThat(p3.isValid(), () -> p3 + " invalid");
+        CheckParameterUtil.ensureThat(p4.isValid(), () -> p4 + " invalid");
 
         // Basically, the formula from wikipedia is used:
@@ -402,8 +402,8 @@
     public static boolean segmentsParallel(EastNorth p1, EastNorth p2, EastNorth p3, EastNorth p4) {
 
-        CheckParameterUtil.ensure(p1, "p1", EastNorth::isValid);
-        CheckParameterUtil.ensure(p2, "p2", EastNorth::isValid);
-        CheckParameterUtil.ensure(p3, "p3", EastNorth::isValid);
-        CheckParameterUtil.ensure(p4, "p4", EastNorth::isValid);
+        CheckParameterUtil.ensureThat(p1.isValid(), () -> p1 + " invalid");
+        CheckParameterUtil.ensureThat(p2.isValid(), () -> p2 + " invalid");
+        CheckParameterUtil.ensureThat(p3.isValid(), () -> p3 + " invalid");
+        CheckParameterUtil.ensureThat(p4.isValid(), () -> p4 + " invalid");
 
         // Convert line from (point, point) form to ax+by=c
@@ -488,7 +488,7 @@
     public static boolean angleIsClockwise(EastNorth commonNode, EastNorth firstNode, EastNorth secondNode) {
 
-        CheckParameterUtil.ensure(commonNode, "commonNode", EastNorth::isValid);
-        CheckParameterUtil.ensure(firstNode, "firstNode", EastNorth::isValid);
-        CheckParameterUtil.ensure(secondNode, "secondNode", EastNorth::isValid);
+        CheckParameterUtil.ensureThat(commonNode.isValid(), () -> commonNode + " invalid");
+        CheckParameterUtil.ensureThat(firstNode.isValid(), () -> firstNode + " invalid");
+        CheckParameterUtil.ensureThat(secondNode.isValid(), () -> secondNode + " invalid");
 
         double dy1 = firstNode.getY() - commonNode.getY();
@@ -834,6 +834,6 @@
     public static double getSegmentAngle(EastNorth p1, EastNorth p2) {
 
-        CheckParameterUtil.ensure(p1, "p1", EastNorth::isValid);
-        CheckParameterUtil.ensure(p2, "p2", EastNorth::isValid);
+        CheckParameterUtil.ensureThat(p1.isValid(), () -> p1 + " invalid");
+        CheckParameterUtil.ensureThat(p2.isValid(), () -> p2 + " invalid");
 
         return Math.atan2(p2.north() - p1.north(), p2.east() - p1.east());
@@ -850,7 +850,7 @@
     public static double getCornerAngle(EastNorth p1, EastNorth common, EastNorth p3) {
 
-        CheckParameterUtil.ensure(p1, "p1", EastNorth::isValid);
-        CheckParameterUtil.ensure(common, "p2", EastNorth::isValid);
-        CheckParameterUtil.ensure(p3, "p3", EastNorth::isValid);
+        CheckParameterUtil.ensureThat(p1.isValid(), () -> p1 + " invalid");
+        CheckParameterUtil.ensureThat(common.isValid(), () -> common + " invalid");
+        CheckParameterUtil.ensureThat(p3.isValid(), () -> p3 + " invalid");
 
         double result = getSegmentAngle(common, p1) - getSegmentAngle(common, p3);
Index: /trunk/src/org/openstreetmap/josm/tools/HiDPISupport.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/HiDPISupport.java	(revision 16055)
+++ /trunk/src/org/openstreetmap/josm/tools/HiDPISupport.java	(revision 16056)
@@ -69,5 +69,5 @@
      */
     public static Image getMultiResolutionImage(List<Image> imgs) {
-        CheckParameterUtil.ensure(imgs, "imgs", "not empty", ls -> !ls.isEmpty());
+        CheckParameterUtil.ensureThat(!imgs.isEmpty(), "imgs is empty");
         Optional<Constructor<? extends Image>> baseMrImageConstructor = getBaseMultiResolutionImageConstructor();
         if (baseMrImageConstructor.isPresent()) {
