Do you use the assert
keyword or throw some validation runtime exception? What benefits does it give to you or why do you think it\'s not worth it to use?
To be precise on your question :
Assert is used to validate the condition of a statement.
assert (some condition)
Example : assert (6 < 7) // condition pass
assert (6 > 7) // throws AssertionException here
Most people use assert for the following use case for String : (But I personally hate to use assert for it) :
assert (obj != null || obj.isEmpty() || ... )
I rather like using google guava which is clean and serve the purpose :
Obj.isNullOrEmpty()
More info : http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Strings.html