This is an automated email from the ASF dual-hosted git repository. aherbert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-geometry.git
commit 2eb145e7f8e3a35547554b05f84a90c9350bd0e5 Author: Alex Herbert <aherb...@apache.org> AuthorDate: Fri Apr 25 15:07:54 2025 +0100 Use method reference --- .../geometry/euclidean/oned/AffineTransformMatrix1DTest.java | 2 +- .../commons/geometry/io/core/internal/SimpleTextParserTest.java | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/AffineTransformMatrix1DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/AffineTransformMatrix1DTest.java index 80561720..235ff31f 100644 --- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/AffineTransformMatrix1DTest.java +++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/AffineTransformMatrix1DTest.java @@ -631,7 +631,7 @@ class AffineTransformMatrix1DTest { void testNormalTransform_nonInvertible() { // act/assert final AffineTransformMatrix1D transform = AffineTransformMatrix1D.createScale(0); - Assertions.assertThrows(IllegalStateException.class, () -> transform.normalTransform()); + Assertions.assertThrows(IllegalStateException.class, transform::normalTransform); } @Test diff --git a/commons-geometry-io-core/src/test/java/org/apache/commons/geometry/io/core/internal/SimpleTextParserTest.java b/commons-geometry-io-core/src/test/java/org/apache/commons/geometry/io/core/internal/SimpleTextParserTest.java index a820533b..9acafd21 100644 --- a/commons-geometry-io-core/src/test/java/org/apache/commons/geometry/io/core/internal/SimpleTextParserTest.java +++ b/commons-geometry-io-core/src/test/java/org/apache/commons/geometry/io/core/internal/SimpleTextParserTest.java @@ -274,7 +274,7 @@ class SimpleTextParserTest { p.nextLine(); // act/assert - final Throwable exc = Assertions.assertThrows(IllegalStateException.class, () -> p.getCurrentTokenAsDouble()); + final Throwable exc = Assertions.assertThrows(IllegalStateException.class, p::getCurrentTokenAsDouble); Assertions.assertEquals(NumberFormatException.class, exc.getCause().getClass()); } @@ -342,7 +342,7 @@ class SimpleTextParserTest { p.nextLine(); // act/assert - final Throwable exc = Assertions.assertThrows(IllegalStateException.class, () -> p.getCurrentTokenAsInt()); + final Throwable exc = Assertions.assertThrows(IllegalStateException.class, p::getCurrentTokenAsInt); Assertions.assertEquals(NumberFormatException.class, exc.getCause().getClass()); } @@ -1058,9 +1058,8 @@ class SimpleTextParserTest { p.chooseIgnoreCase("X", "Y", "Z"); }, IllegalStateException.class, "Parsing failed at line 1, column 1: expected one of [X, Y, Z] but found [a]"); - GeometryTestUtils.assertThrowsWithMessage(() -> { - p.chooseIgnoreCase(); - }, IllegalStateException.class, "Parsing failed at line 1, column 1: expected one of [] but found [a]"); + GeometryTestUtils.assertThrowsWithMessage(p::chooseIgnoreCase, + IllegalStateException.class, "Parsing failed at line 1, column 1: expected one of [] but found [a]"); } @Test