awaitility/src/main/java/org/awaitility/Awaitility.java
public static void pollInSameThread() {
        defaultExecutorLifecycle = ExecutorLifecycle.withNormalCleanupBehavior(new Supplier<ExecutorService>() {
            @Override
            public ExecutorService get() {
                return InternalExecutorServiceFactory.sameThreadExecutorService();
            }
        });
    }
public static void pollInSameThread() {
        defaultExecutorLifecycle = ExecutorLifecycle.withNormalCleanupBehavior(new Supplier<ExecutorService>() {
            @Override
            public ExecutorService get() {
                return InternalExecutorServiceFactory.sameThreadExecutorService();
            }
        });
    }
Instructs Awaitility to execute the polling of the condition from the same as the test.
This is an advanced feature and you should be careful when combining this with conditions that
wait forever (or a long time) since Awaitility cannot interrupt the thread when using the same
thread as the test. For safety you should always combine tests using this feature with a test framework specific timeout,
for example in JUnit:
<pre>
@Test(timeout = 2000L)
public void myTest() {
Awaitility.pollInSameThread();
await().forever().until(...);
}
</pre>

@since 3.0.0