# io.github.libtmux.query.Selections.Selections.oneOrEmpty

- **Module:** io.github.libtmux.query.Selections.Selections
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-java/blob/c3517519ee799428a809ce6deb1708c8be289cd1/libtmux/src/main/java/io/github/libtmux/query/Selections.java#L36
- **Page:** https://libtmux.org/reference/java/io-github-libtmux-query-selections-selections-oneorempty/

```
io.github.libtmux.query.Selections.Selections.oneOrEmpty(matches: Iterable<T>) -> Optional<T>
```

The single match if there is one, empty if there is none — but still a failure for several.

<p>Returning the first of many would make a caller's ambiguous query look answered.
