The method isEmpty() is a convenience method that checks if the size of a String is equal to zero.

Available Signatures

public boolean isEmpty()

Example

@Test
public void whenCallIsEmpty_thenCorrect() {
    String s1 = "";
    
    assertTrue(s1.isEmpty());
}