GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — BAEL-7178: StringUtils.isBlank() vs String.isEmpty() (#15213) · FEDENG01/tutorials@aef39e7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • core-java-modules/core-java-string-operations-7/src/test/java/com/baeldung/isemptyvsisblank
    • StringIsEmptyVsIsBlankUnitTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎core-java-modules/core-java-string-operations-7/src/test/java/com/baeldung/isemptyvsisblank/StringIsEmptyVsIsBlankUnitTest.java‎

Copy file name to clipboard
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.baeldung.isemptyvsisblank;
2+
3+
import org.junit.jupiter.api.Test;
4+
5+
import static org.junit.jupiter.api.Assertions.assertFalse;
6+
import static org.junit.jupiter.api.Assertions.assertTrue;
7+
8+
public class StringIsEmptyVsIsBlankUnitTest {
9+
10+
@Test
11+
public void givenString_whenCallIsEmpty_thenReturnCorrectValues() {
12+
assertFalse("Example text".isEmpty());
13+
assertTrue("".isEmpty());
14+
assertFalse(" ".isEmpty());
15+
assertFalse("\t\n\r\f".isEmpty());
16+
}
17+
18+
@Test
19+
public void givenString_whenCallStringIsBlank_thenReturnCorrectValues() {
20+
assertFalse("Example text".isBlank());
21+
assertTrue("".isBlank());
22+
assertTrue(" ".isBlank());
23+
assertTrue("\t\n\r\f ".isBlank());
24+
}
25+
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.