// Path: xvfb-manager/src/main/java/com/github/mike10004/xvfbmanager/Sleeper.java
// class DefaultSleeper implements Sleeper {
// 
//     private DefaultSleeper() {
//     }
// 
//     private static final DefaultSleeper instance = new DefaultSleeper();
// 
//     /**
//      * Gets the singleton instance of this class.
//      * @return the singleton
//      */
//     public static DefaultSleeper getInstance() {
//         return instance;
//     }
// 
//     @Override
//     public void sleep(long millis) throws InterruptedException {
//         Thread.sleep(millis);
//     }
// }


import com.github.mike10004.xvfbmanager.Sleeper.DefaultSleeper;
import javax.annotation.Nullable;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.Iterator;
import java.util.function.Supplier;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
package com.github.mike10004.xvfbmanager;




/**
 * Class that facilitates polling for an arbitrary condition. Polling is
 * the act of repeatedly querying the state at defined intervals. Polling
 * stops when this poller's {@link #check(int) evaluation function}
 * answers with a reason to stop, or the iterator of intervals to wait
 * between polls is exhausted. Reasons to stop include
 * {@link PollAction#RESOLVE resolution}, meaning the poller is satisfied
 * with the result, or {@link PollAction#ABORT abortion} meaning polling
 * must stop early without a resolution.
 *
 * @param <T> type of content returned upon resolution
 */
public abstract class Poller<T> {

    private final Sleeper sleeper;

    /**
     * Creates a new poller. The poller waits between polls using the
     * default {@link Sleeper}. Subclasses can use an alternate sleeper,
     * is helpful if you want to test your poller without actually waiting.
     */
    public Poller() {
// Path: xvfb-manager/src/main/java/com/github/mike10004/xvfbmanager/Sleeper.java
// class DefaultSleeper implements Sleeper {
// 
//     private DefaultSleeper() {
//     }
// 
//     private static final DefaultSleeper instance = new DefaultSleeper();
// 
//     /**
//      * Gets the singleton instance of this class.
//      * @return the singleton
//      */
//     public static DefaultSleeper getInstance() {
//         return instance;
//     }
// 
//     @Override
//     public void sleep(long millis) throws InterruptedException {
//         Thread.sleep(millis);
//     }
// }


// Path: xvfb-manager/src/main/java/com/github/mike10004/xvfbmanager/Poller.java
import com.github.mike10004.xvfbmanager.Sleeper.DefaultSleeper;
import javax.annotation.Nullable;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.Iterator;
import java.util.function.Supplier;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;

package com.github.mike10004.xvfbmanager;




/**
 * Class that facilitates polling for an arbitrary condition. Polling is
 * the act of repeatedly querying the state at defined intervals. Polling
 * stops when this poller's {@link #check(int) evaluation function}
 * answers with a reason to stop, or the iterator of intervals to wait
 * between polls is exhausted. Reasons to stop include
 * {@link PollAction#RESOLVE resolution}, meaning the poller is satisfied
 * with the result, or {@link PollAction#ABORT abortion} meaning polling
 * must stop early without a resolution.
 *
 * @param <T> type of content returned upon resolution
 */
public abstract class Poller<T> {

    private final Sleeper sleeper;

    /**
     * Creates a new poller. The poller waits between polls using the
     * default {@link Sleeper}. Subclasses can use an alternate sleeper,
     * is helpful if you want to test your poller without actually waiting.
     */
    public Poller() {
        this(DefaultSleeper.getInstance());