diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/JavaParserTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/JavaParserTest.java index bb0686a5bd6..8a49b93b53b 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/JavaParserTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/JavaParserTest.java @@ -105,12 +105,6 @@ public void testAppendHiddenBlockCommentNodes() throws Exception { .isEqualTo(1); } - /** - * Temporary java doc. - * - * @noinspection OptionalGetWithoutIsPresent - * @noinspectionreason OptionalGetWithoutIsPresent - until issue #14625 - */ @Test public void testAppendHiddenSingleLineCommentNodes() throws Exception { final DetailAST root = @@ -120,10 +114,10 @@ public void testAppendHiddenSingleLineCommentNodes() throws Exception { final Optional singleLineComment = TestUtil.findTokenInAstByPredicate(root, ast -> ast.getType() == TokenTypes.SINGLE_LINE_COMMENT); assertWithMessage("Single line comment should be present") - .that(singleLineComment.isPresent()) - .isTrue(); + .that(singleLineComment.isPresent()) + .isTrue(); - final DetailAST comment = singleLineComment.get(); + final DetailAST comment = singleLineComment.orElseThrow(); assertWithMessage("Unexpected line number") .that(comment.getLineNo())