This test class defines a method isValid that returns true only if the input string is not null and not empty.
The test method testIsValidWithNullAndEmpty is annotated with @ParameterizedTest, @NullSource, and @EmptySource. This means the test will run twice: once with null and once with an empty string ("").
Inside the test, assertFalse checks that isValid returns false for both inputs, which matches the expected behavior.
This approach is clean and concise, covering two important edge cases without writing separate tests.