androidxannotationTestOnly
androidx.annotation.TestOnly is a marker annotation in the AndroidX Annotation library used to indicate that a program element is intended only for test code. It can be applied to methods, fields, constructors, or classes to signal that they should not be used from production or non-test code.
The primary purpose of TestOnly is to aid developers and static analysis tools by documenting and enforcing
Usage is straightforward: annotate the relevant element with @TestOnly, and ensure your project includes the AndroidX
In addition to TestOnly, other testing-related annotations like @VisibleForTesting are commonly used to express related intent