# Getting Started

Site [llms.txt](/gatherers4j/llms.txt)

---

Gatherers4j releases are published to Maven Central; the latest version is 0.15.0.

### Maven

Add the following dependency to `pom.xml`:

```xml
<dependency>
    <groupId>com.ginsberg</groupId>
    <artifactId>gatherers4j</artifactId>
    <version>0.15.0</version>
</dependency>
```
### Gradle

Add the following dependency to `build.gradle` or `build.gradle.kts`:

```groovy
implementation("com.ginsberg:gatherers4j:0.15.0")
```

### Example Usage

The `Gatherers4j` class is the main entrypoint for this library. 

Here's a simple example that imports `Gatherers4j`, sets up a `Stream<String>`, 
keeps the last three elements, and puts them in a `List<String>`:

```java
import com.ginsberg.gatherers4j.Gatherers4j;
import java.util.stream.Stream;

Stream.of("A", "B", "C", "D", "E")
    .gather(Gatherers4j.takeLast(3))
    .toList();

// Returns: [ "C", "D", "E" ]
```
