public class Sleep extends ConditionalSleep {
private BooleanSupplier condition;
public Sleep(BooleanSupplier condition, int timeout) {
super(timeout);
this.condition = condition;
}
@Override
public boolean condition() throws InterruptedException {
return condition.getAsBoolean();
}
public static boolean sleepUntil(BooleanSupplier condition, int timeout) {
return new Sleep(condition, timeout).sleep();
}
}
I got this class from a tutorial, but I'm trying to unders