Check their javadoc.检查他们的javadoc。For example: @RunWith has a @Target(value=TYPE) annotation, so it's only applicable to types.例如: @RunWith具有@Target(value=TYPE)批注,因此它仅适用于类型。@Test has a @Target(value=METHOD) annotation, so it's only applicable to methods.@Test具有@Target(value=METHOD)批注,因此它仅适用于方法。