# SparseBooleanArraySubject

Artifact: [androidx.test.ext:truth](https://developer.android.com/jetpack/androidx/releases/test-ext) [View Source](https://cs.android.com/search?q=file:androidx/test/ext/truth/util/SparseBooleanArraySubject.java+class:androidx.test.ext.truth.util.SparseBooleanArraySubject)

*** ** * ** ***

<br />

```
public final class SparseBooleanArraySubject extends Subject
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [com.google.common.truth.Subject](https://truth.dev/api/0.41/com/google/common/truth/Subject.html) ||
|   | ↳ | [androidx.test.ext.truth.util.SparseBooleanArraySubject](https://developer.android.com/reference/androidx/test/ext/truth/util/SparseBooleanArraySubject) |

*** ** * ** ***

Subject for making assertions about `https://developer.android.com/reference/android/util/SparseBooleanArray.html`s.

## Summary

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/androidx/test/ext/truth/util/SparseBooleanArraySubject` | `https://developer.android.com/reference/androidx/test/ext/truth/util/SparseBooleanArraySubject#assertThat(android.util.SparseBooleanArray)(https://developer.android.com/reference/android/util/SparseBooleanArray.html actual)` Begins an assertion on a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/util/SparseBooleanArraySubject#containsKey(int)(int key)` Assert that a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` contains the given key |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/util/SparseBooleanArraySubject#doesNotContainKey(int)(int key)` Assert that a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` doesn't contain the given key |
| `static https://developer.android.com/reference/java/lang/AssertionError.html` | `https://developer.android.com/reference/androidx/test/ext/truth/util/SparseBooleanArraySubject#expectFailure(com.google.common.truth.ExpectFailure.SimpleSubjectBuilderCallback<androidx.test.ext.truth.util.SparseBooleanArraySubject,android.util.SparseBooleanArray>)( https://truth.dev/api/0.41/com/google/common/truth/ExpectFailure.SimpleSubjectBuilderCallback.html<https://developer.android.com/reference/androidx/test/ext/truth/util/SparseBooleanArraySubject, https://developer.android.com/reference/android/util/SparseBooleanArray.html> callback )` Begins an assertion on a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` where a predicate is expected to fail |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/util/SparseBooleanArraySubject#hasFalseValueAt(int)(int key)` Assert that a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` for the given key returns the value false |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/util/SparseBooleanArraySubject#hasSize(int)(int size)` Assert that a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` has size |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/util/SparseBooleanArraySubject#hasTrueValueAt(int)(int key)` Assert that a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` for the given key returns the value true |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/util/SparseBooleanArraySubject#isEmpty()()` Assert that a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` is empty |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/util/SparseBooleanArraySubject#isNotEmpty()()` Assert that a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` is not empty |

### Inherited methods

From [com.google.common.truth.Subject](https://truth.dev/api/0.41/com/google/common/truth/Subject.html) `https://developer.android.com/reference/java/lang/String.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#actualCustomStringRepresentation--()` `final boolean` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#equals-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html o)`

**This method is deprecated.**
`final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#failWithActual-java.lang.String-java.lang.Object-(https://developer.android.com/reference/java/lang/String.html key, https://developer.android.com/reference/java/lang/Object.html value)` `final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#failWithoutActual-com.google.common.truth.Fact-com.google.common.truth.Fact...-(https://truth.dev/api/0.41/com/google/common/truth/Fact.html first, Fact[] rest)` `final int` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#hashCode--()`

**This method is deprecated.**
`final https://truth.dev/api/0.41/com/google/common/truth/StandardSubjectBuilder.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#ignoreCheck--()` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isAnyOf-java.lang.Object-java.lang.Object-java.lang.Object...-(https://developer.android.com/reference/java/lang/Object.html first, https://developer.android.com/reference/java/lang/Object.html second, Object[] rest)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isEqualTo-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html expected)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isIn-java.lang.Iterable&lt;?&gt;-(https://developer.android.com/reference/java/lang/Iterable.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> iterable)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isInstanceOf-java.lang.Class&lt;?&gt;-(https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> clazz)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNoneOf-java.lang.Object-java.lang.Object-java.lang.Object...-(https://developer.android.com/reference/java/lang/Object.html first, https://developer.android.com/reference/java/lang/Object.html second, Object[] rest)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotEqualTo-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html unexpected)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotIn-java.lang.Iterable&lt;?&gt;-(https://developer.android.com/reference/java/lang/Iterable.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> iterable)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotInstanceOf-java.lang.Class&lt;?&gt;-(https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> clazz)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotNull--()` `final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotSameInstanceAs-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html unexpected)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNull--()` `final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isSameInstanceAs-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html expected)` `https://developer.android.com/reference/java/lang/String.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#toString--()`

## Public methods

### assertThat

```
public static SparseBooleanArraySubject assertThat(SparseBooleanArray actual)
```

Begins an assertion on a `https://developer.android.com/reference/android/util/SparseBooleanArray.html`

### containsKey

```
public void containsKey(int key)
```

Assert that a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` contains the given key

### doesNotContainKey

```
public void doesNotContainKey(int key)
```

Assert that a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` doesn't contain the given key

### expectFailure

```
public static AssertionError expectFailure(
    ExpectFailure.SimpleSubjectBuilderCallback<SparseBooleanArraySubject, SparseBooleanArray> callback
)
```

Begins an assertion on a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` where a predicate is expected to fail

### hasFalseValueAt

```
public void hasFalseValueAt(int key)
```

Assert that a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` for the given key returns the value false

### hasSize

```
public void hasSize(int size)
```

Assert that a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` has size

### hasTrueValueAt

```
public void hasTrueValueAt(int key)
```

Assert that a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` for the given key returns the value true

### isEmpty

```
public void isEmpty()
```

Assert that a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` is empty

### isNotEmpty

```
public void isNotEmpty()
```

Assert that a `https://developer.android.com/reference/android/util/SparseBooleanArray.html` is not empty