The following code is not throwing any error and it is a stand alone java program. Instead, if i pass null, it will print null in console. Please help me out, how to enable @notnull annotation.
import javax.validation.constraints.NotNull;
public class TestNotNull {
public void testNotNull(@NotNull(message = "name is compulsory") String name)
{
System.out.println(name);
}
public static void main(String... args)
{
TestNotNull testNotNull = new TestNotNull();
testNotNull.testNotNull(null);
}
}