# AnchorSpaceTester

Artifact: [androidx.xr.scenecore:scenecore-testing](https://developer.android.com/jetpack/androidx/releases/xr-scenecore) [View Source](https://cs.android.com/search?q=file:androidx/xr/scenecore/testing/AnchorSpaceTester.kt+class:androidx.xr.scenecore.testing.AnchorSpaceTester) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
class AnchorSpaceTester
```

<br />

*** ** * ** ***

A test-only accessor for `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/AnchorSpace` that enables direct manipulation and inspection of its internal state.

## Summary

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/AnchorSpaceTester#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/AnchorSpaceTester#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/AnchorSpaceTester#triggerOnOriginChanged()()` Simulates a change to the underlying space's origin. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/AnchorSpace.State?` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/AnchorSpaceTester#state()` The state of the AnchorSpace. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### triggerOnOriginChanged

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
fun triggerOnOriginChanged(): Unit
```

Simulates a change to the underlying space's origin.

This function manually triggers any listeners registered via `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/AnchorSpace#addOriginChangedListener(java.util.concurrent.Executor,java.lang.Runnable)`, allowing tests to verify that the application correctly responds to spatial updates from the system.

## Public properties

### state

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
var state: AnchorSpace.State?
```

The state of the AnchorSpace.

Setting this property simulates a system-level state change (e.g., from `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/AnchorSpace.State#UNANCHORED()` to `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/AnchorSpace.State#ANCHORED()`) and triggers the listener set by `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/AnchorSpace#addStateChangedListener(java.util.function.Consumer)`.