diff --git a/exercises/practice/two-bucket/.meta/src/reference/java/TwoBucket.java b/exercises/practice/two-bucket/.meta/src/reference/java/TwoBucket.java index 9d8d18e1e..3cf41ccf7 100644 --- a/exercises/practice/two-bucket/.meta/src/reference/java/TwoBucket.java +++ b/exercises/practice/two-bucket/.meta/src/reference/java/TwoBucket.java @@ -105,7 +105,7 @@ private void checkIfImpossible(int desiredLiters, int bucketOneCap, int bucketTw boolean invalidDivision = desiredLiters % gcd(bucketOneCap, bucketTwoCap) != 0; if (exceedsCapacity || invalidDivision) { - throw new UnreachableGoalException("impossible"); + throw new UnreachableGoalException(); } } diff --git a/exercises/practice/two-bucket/src/test/java/TwoBucketTest.java b/exercises/practice/two-bucket/src/test/java/TwoBucketTest.java index 36fbf21d8..3564951ab 100644 --- a/exercises/practice/two-bucket/src/test/java/TwoBucketTest.java +++ b/exercises/practice/two-bucket/src/test/java/TwoBucketTest.java @@ -82,8 +82,7 @@ public void testBucketOneSizeTwoBucketTwoSizeThreeStartWithOne() { public void testReachingGoalIsImpossible() { assertThatExceptionOfType(UnreachableGoalException.class) - .isThrownBy(() -> new TwoBucket(6, 15, 5, "one").getResult()) - .withMessage("impossible"); + .isThrownBy(() -> new TwoBucket(6, 15, 5, "one").getResult()); } @@ -104,8 +103,7 @@ public void testBucketOneSizeSixBucketTwoSizeFifteenStartWithOne() { public void testGoalLargerThanBothBucketsIsImpossible() { assertThatExceptionOfType(UnreachableGoalException.class) - .isThrownBy(() -> new TwoBucket(5, 7, 8, "one").getResult()) - .withMessage("impossible"); + .isThrownBy(() -> new TwoBucket(5, 7, 8, "one").getResult()); } }