What is the benifit of using the @VisibleForTesting annotation?

✅  The correct answer is:

  • to denote that a class, methos, or field has its visibility relaxed to make code testable

Question:

What is the benifit of using the @VisibleForTesting annotation?

Solution:

  • to denote that a class, methos, or field has its visibility relaxed to make code testable
  • to denote that a class, method, or field is visible only in the test code
  • to denote that a class, method, or field has its visibility increased to make code less testable
  • to throw a run-time error if a class, methos, or field with this annotation is accessed improperly