// Path: src/main/java/pl/domzal/junit/docker/rule/wait/StartConditionCheck.java
// public interface StartConditionCheck {
// 
//     /**
//      * 'Is condition fulfilled?' check.
//      */
//     boolean check();
// 
//     /**
//      * Condition description (will show in log messages).
//      */
//     String describe();
// 
//     /**
//      * After check cleanup. Use if you check need to do some cleaning after usage.
//      */
//     void after();
// 
// }


import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pl.domzal.junit.docker.rule.wait.StartConditionCheck;
package pl.domzal.junit.docker.rule;




/**
 * Helper class to block on given {@link WaitForContainer}.
 */
class WaitForContainer {

    private static Logger log = LoggerFactory.getLogger(WaitForContainer.class);

    /**
     * Wait till all given conditions are met.
     *
     * @param condition Conditions to wait for - all must be met to continue.
     * @param timeoutSeconds Wait timeout.
     * @param containerDescription Container description. For log and exception message usage only.
     */
// Path: src/main/java/pl/domzal/junit/docker/rule/wait/StartConditionCheck.java
// public interface StartConditionCheck {
// 
//     /**
//      * 'Is condition fulfilled?' check.
//      */
//     boolean check();
// 
//     /**
//      * Condition description (will show in log messages).
//      */
//     String describe();
// 
//     /**
//      * After check cleanup. Use if you check need to do some cleaning after usage.
//      */
//     void after();
// 
// }


// Path: src/main/java/pl/domzal/junit/docker/rule/WaitForContainer.java
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pl.domzal.junit.docker.rule.wait.StartConditionCheck;

package pl.domzal.junit.docker.rule;




/**
 * Helper class to block on given {@link WaitForContainer}.
 */
class WaitForContainer {

    private static Logger log = LoggerFactory.getLogger(WaitForContainer.class);

    /**
     * Wait till all given conditions are met.
     *
     * @param condition Conditions to wait for - all must be met to continue.
     * @param timeoutSeconds Wait timeout.
     * @param containerDescription Container description. For log and exception message usage only.
     */
    static void waitForCondition(final StartConditionCheck condition, int timeoutSeconds, final String containerDescription) throws TimeoutException {