# Checks

# Checks

Artifact: [androidx.test.espresso:espresso-intents](https://developer.android.com/jetpack/androidx/releases/test-espresso)  
[View Source](https://cs.android.com/search?q=file:androidx/test/espresso/intent/Checks.java+class:androidx.test.espresso.intent.Checks)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/test/espresso/intent/Checks "View this page in Java")


```
class Checks
```

<br />

*** ** * ** ***

Substitute for Guava Preconditions to avoid dependency.

## Summary

|                                    ### Public functions                                     |
|---------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [checkArgument](https://developer.android.com/reference/kotlin/androidx/test/espresso/intent/Checks#checkArgument(boolean))`(expression: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)`                                                                                                                                                                                                                                                                                                                                                     |
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [checkArgument](https://developer.android.com/reference/kotlin/androidx/test/espresso/intent/Checks#checkArgument(boolean,java.lang.Object))`(expression: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`, errorMessage: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`!)`                                                                                                                                                                                                                                      |
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [checkArgument](https://developer.android.com/reference/kotlin/androidx/test/espresso/intent/Checks#checkArgument(boolean,java.lang.String,java.lang.Object...))`(` ` expression: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`,` ` errorMessageTemplate: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!,` ` errorMessageArgs: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`!>!` `)` |
| `java-static T!`                                                                            | `<T> `[checkNotNull](https://developer.android.com/reference/kotlin/androidx/test/espresso/intent/Checks#checkNotNull(T))`(reference: T!)`                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `java-static T!`                                                                            | `<T> `[checkNotNull](https://developer.android.com/reference/kotlin/androidx/test/espresso/intent/Checks#checkNotNull(T,java.lang.Object))`(reference: T!, errorMessage: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`!)`                                                                                                                                                                                                                                                                                                                            |
| `java-static T!`                                                                            | `<T> `[checkNotNull](https://developer.android.com/reference/kotlin/androidx/test/espresso/intent/Checks#checkNotNull(T,java.lang.String,java.lang.Object...))`(` ` reference: T!,` ` errorMessageTemplate: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!,` ` errorMessageArgs: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`!>!` `)`                                                                                       |
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [checkState](https://developer.android.com/reference/kotlin/androidx/test/espresso/intent/Checks#checkState(boolean,java.lang.Object))`(expression: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`, errorMessage: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`!)`                                                                                                                                                                                                                                            |
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [checkState](https://developer.android.com/reference/kotlin/androidx/test/espresso/intent/Checks#checkState(boolean,java.lang.String,java.lang.Object...))`(` ` expression: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`,` ` errorMessageTemplate: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!,` ` errorMessageArgs: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`!>!` `)`       |

## Public functions

### checkArgument

```
java-static fun checkArgument(expression: Boolean): Unit
```  

### checkArgument

```
java-static fun checkArgument(expression: Boolean, errorMessage: Any!): Unit
```  

### checkArgument

```
java-static fun checkArgument(
    expression: Boolean,
    errorMessageTemplate: String!,
    errorMessageArgs: Array<Any!>!
): Unit
```  

### checkNotNull

```
java-static fun <T> checkNotNull(reference: T!): T!
```  

### checkNotNull

```
java-static fun <T> checkNotNull(reference: T!, errorMessage: Any!): T!
```  

### checkNotNull

```
java-static fun <T> checkNotNull(
    reference: T!,
    errorMessageTemplate: String!,
    errorMessageArgs: Array<Any!>!
): T!
```  

### checkState

```
java-static fun checkState(expression: Boolean, errorMessage: Any!): Unit
```  

### checkState

```
java-static fun checkState(
    expression: Boolean,
    errorMessageTemplate: String!,
    errorMessageArgs: Array<Any!>!
): Unit
```