> For the complete documentation index, see [llms.txt](https://fredhopper.gitbook.io/product-discovery/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fredhopper.gitbook.io/product-discovery/a-b-testing-for-fhr/integration-steps-for-a-caching-solution/java-sdk-integration/retrieve-running-a-b-tests-java-sdk.md).

# Retrieve running A/B tests - Java SDK

As mentioned in the previous section, once the **AbTesting** object has been initialized and `start()` has been called, the **SDK** commences with periodic requests to retrieve and cache the currently **running A/B tests.**

```java
 import com.attraqt.sdk.fhr.abtesting.AbTesting

...

AbTesting abTesting = AbTesting.builder()
                               .abTestsServerUrl("url")
                               .username("username")
                               .password("password")       
                               .build();

abTesting.start();
```

{% hint style="info" %}
**Important!** The AbTesting object should be created and started **once** per application instance and shared between web requests.
{% endhint %}

Once the retrieval has started, you can call the `isStarted()` method to check whether the process is started, like so:

```java
boolean isStarted = abTesting.isStarted();
```

Additionally, if you want to stop the retrieval, you can call the `shutdown()` method which will stop the **retrieval** and **clean** **up** any of the **cached** **results**.

```java
abTesting.shutdown();
```

{% hint style="info" %}
**Important!** The SDK works completely in memory so any stored queries and data will be available for as long as the application is running.
{% endhint %}

When you have your **retrieval** of **running** **A/B tests** fully functioning you can move on to the next section which covers the **filtering** of the **A/B tests** for a given page, and assigning variants to the user.

{% content-ref url="/pages/8vcFgs0nVQA54bZQquvJ" %}
[Filter and request variant - Java SDK](/product-discovery/a-b-testing-for-fhr/integration-steps-for-a-caching-solution/java-sdk-integration/filter-and-request-variant-java-sdk.md)
{% endcontent-ref %}
