// Path: xvfb-manager/src/main/java/com/github/mike10004/xvfbmanager/XvfbController.java
// public interface XvfbController extends Closeable {
// 
//     String ENV_DISPLAY = "DISPLAY";
// 
//     /**
//      * Waits until the display is ready, using default values for the polling
//      * interval and maximum polls. Implementations may select the defaults
//      * to use.
//      * @throws InterruptedException if waiting is interrupted
//      * @see #waitUntilReady(long, int)
//      */
//     void waitUntilReady() throws InterruptedException;
// 
//     /**
//      * Waits until the X display is ready, polling at a given interval until the
//      * display is ready or the given number of polls has been executed.
//      * @param pollIntervalMs interval between polls in milliseconds
//      * @param maxNumPolls maximum number of polls to execute
//      * @throws InterruptedException if waiting is interrupted
//      */
//     void waitUntilReady(long pollIntervalMs, int maxNumPolls) throws InterruptedException;
// 
//     /**
//      * Stops the virtual framebuffer process.
//      */
//     void stop();
// 
//     /**
//      * Gets the display number in the format {@code :N} where {@code N} is the display number.
//      * @return the display
//      */
//     String getDisplay();
// 
//     /**
//      * Sets the display environment variable in the given environment.
//      * @param environment map of environment variables in which display is to be set
//      * @return the argument environment object
//      * @see #ENV_DISPLAY
//      */
//     Map<String, String> configureEnvironment(Map<String, String> environment);
// 
//     /**
//      * Creates a new, mutable environment variable map with the display variable set.
//      * @return the new environment map
//      * @see #configureEnvironment(Map)
//      */
//     @SuppressWarnings("unused")
//     Map<String, String> newEnvironment();
// 
//     /**
//      * Captures a screenshot of the virtual framebuffer.
//      * @return the screenshot
//      * @throws XvfbException if screenshooting goes awry
//      */
//     Screenshooter<?> getScreenshooter() throws XvfbException;
// 
//     /**
//      * Class representing information about a window rendered by an X server.
//      */
//     class XWindow {
// 
//         /**
//          * Window ID. This is commonly an integer in hexadecimal format, for example {@code 0x38ab0e}.
//          */
//         public final String id;
// 
//         /**
//          * Window title. Null means the window has no title. The title may also
//          * be empty, though that is not common.
//          */
//         public final @Nullable String title;
// 
//         /**
//          * The line of output from which this window instance was parsed. This is a
//          * line from {@code }
//          */
//         public final String line;
// 
//         /**
//          * Constructs a new instance of the class.
//          * @param id window id
//          * @param title window title
//          * @param line line of output from which this window information was parsed
//          */
//         public XWindow(String id, @Nullable String title, String line) {
//             this.id = id;
//             this.title = title;
//             this.line = line;
//         }
// 
//         @Override
//         public String toString() {
//             return "XWindow{" +
//                     "id=" + id +
//                     ", title='" + title + '\'' +
//                     ", length=" + (line == null ? -1 : line.length()) +
//                     '}';
//         }
// 
//         @Override
//         public boolean equals(Object o) {
//             if (this == o) return true;
//             if (o == null || getClass() != o.getClass()) return false;
// 
//             XWindow xWindow = (XWindow) o;
// 
//             if (id != null ? !id.equals(xWindow.id) : xWindow.id != null) return false;
//             if (title != null ? !title.equals(xWindow.title) : xWindow.title != null) return false;
//             return line != null ? line.equals(xWindow.line) : xWindow.line == null;
//         }
// 
//         @Override
//         public int hashCode() {
//             int result = id != null ? id.hashCode() : 0;
//             result = 31 * result + (title != null ? title.hashCode() : 0);
//             result = 31 * result + (line != null ? line.hashCode() : 0);
//             return result;
//         }
//     }
// 
//     Optional<TreeNode<XWindow>> pollForWindow(Predicate<XWindow> windowFinder, long intervalMs, int maxPollAttempts) throws InterruptedException;
// 
// }


import com.github.mike10004.nativehelper.Platforms;
import io.github.mike10004.subprocess.SubprocessLaunchException;
import com.github.mike10004.xvfbmanager.XvfbController;
import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import static org.junit.Assert.*;
    public void testDisablingOnWindows() throws Exception {
        System.out.format("testCase = %s%n", testCase);
        AtomicBoolean reachedPreBefore = new AtomicBoolean(false);
        RuleUser ruleUser = new RuleUser(testCase.rule) {
            @Override
            protected void getControllerAndUse(XvfbRule rule) throws Exception {
                if (testCase.invokeGetController) {
                    super.getControllerAndUse(rule);
                }
            }

            @Override
            protected void preBefore() throws Exception {
                reachedPreBefore.set(true);
            }

            @Override
            protected void postBefore() throws Exception {
                assertFalse("made it past before() with eager start", testCase.eagerStart);
            }

            @Override
            protected void preAfter() throws Exception {
            }

            @Override
            protected void postAfter() throws Exception {
            }

            @Override
// Path: xvfb-manager/src/main/java/com/github/mike10004/xvfbmanager/XvfbController.java
// public interface XvfbController extends Closeable {
// 
//     String ENV_DISPLAY = "DISPLAY";
// 
//     /**
//      * Waits until the display is ready, using default values for the polling
//      * interval and maximum polls. Implementations may select the defaults
//      * to use.
//      * @throws InterruptedException if waiting is interrupted
//      * @see #waitUntilReady(long, int)
//      */
//     void waitUntilReady() throws InterruptedException;
// 
//     /**
//      * Waits until the X display is ready, polling at a given interval until the
//      * display is ready or the given number of polls has been executed.
//      * @param pollIntervalMs interval between polls in milliseconds
//      * @param maxNumPolls maximum number of polls to execute
//      * @throws InterruptedException if waiting is interrupted
//      */
//     void waitUntilReady(long pollIntervalMs, int maxNumPolls) throws InterruptedException;
// 
//     /**
//      * Stops the virtual framebuffer process.
//      */
//     void stop();
// 
//     /**
//      * Gets the display number in the format {@code :N} where {@code N} is the display number.
//      * @return the display
//      */
//     String getDisplay();
// 
//     /**
//      * Sets the display environment variable in the given environment.
//      * @param environment map of environment variables in which display is to be set
//      * @return the argument environment object
//      * @see #ENV_DISPLAY
//      */
//     Map<String, String> configureEnvironment(Map<String, String> environment);
// 
//     /**
//      * Creates a new, mutable environment variable map with the display variable set.
//      * @return the new environment map
//      * @see #configureEnvironment(Map)
//      */
//     @SuppressWarnings("unused")
//     Map<String, String> newEnvironment();
// 
//     /**
//      * Captures a screenshot of the virtual framebuffer.
//      * @return the screenshot
//      * @throws XvfbException if screenshooting goes awry
//      */
//     Screenshooter<?> getScreenshooter() throws XvfbException;
// 
//     /**
//      * Class representing information about a window rendered by an X server.
//      */
//     class XWindow {
// 
//         /**
//          * Window ID. This is commonly an integer in hexadecimal format, for example {@code 0x38ab0e}.
//          */
//         public final String id;
// 
//         /**
//          * Window title. Null means the window has no title. The title may also
//          * be empty, though that is not common.
//          */
//         public final @Nullable String title;
// 
//         /**
//          * The line of output from which this window instance was parsed. This is a
//          * line from {@code }
//          */
//         public final String line;
// 
//         /**
//          * Constructs a new instance of the class.
//          * @param id window id
//          * @param title window title
//          * @param line line of output from which this window information was parsed
//          */
//         public XWindow(String id, @Nullable String title, String line) {
//             this.id = id;
//             this.title = title;
//             this.line = line;
//         }
// 
//         @Override
//         public String toString() {
//             return "XWindow{" +
//                     "id=" + id +
//                     ", title='" + title + '\'' +
//                     ", length=" + (line == null ? -1 : line.length()) +
//                     '}';
//         }
// 
//         @Override
//         public boolean equals(Object o) {
//             if (this == o) return true;
//             if (o == null || getClass() != o.getClass()) return false;
// 
//             XWindow xWindow = (XWindow) o;
// 
//             if (id != null ? !id.equals(xWindow.id) : xWindow.id != null) return false;
//             if (title != null ? !title.equals(xWindow.title) : xWindow.title != null) return false;
//             return line != null ? line.equals(xWindow.line) : xWindow.line == null;
//         }
// 
//         @Override
//         public int hashCode() {
//             int result = id != null ? id.hashCode() : 0;
//             result = 31 * result + (title != null ? title.hashCode() : 0);
//             result = 31 * result + (line != null ? line.hashCode() : 0);
//             return result;
//         }
//     }
// 
//     Optional<TreeNode<XWindow>> pollForWindow(Predicate<XWindow> windowFinder, long intervalMs, int maxPollAttempts) throws InterruptedException;
// 
// }


// Path: xvfb-testing/src/test/java/com/github/mike10004/xvfbtesting/XvfbRule_ForceWindowsTest.java
import com.github.mike10004.nativehelper.Platforms;
import io.github.mike10004.subprocess.SubprocessLaunchException;
import com.github.mike10004.xvfbmanager.XvfbController;
import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import static org.junit.Assert.*;

    public void testDisablingOnWindows() throws Exception {
        System.out.format("testCase = %s%n", testCase);
        AtomicBoolean reachedPreBefore = new AtomicBoolean(false);
        RuleUser ruleUser = new RuleUser(testCase.rule) {
            @Override
            protected void getControllerAndUse(XvfbRule rule) throws Exception {
                if (testCase.invokeGetController) {
                    super.getControllerAndUse(rule);
                }
            }

            @Override
            protected void preBefore() throws Exception {
                reachedPreBefore.set(true);
            }

            @Override
            protected void postBefore() throws Exception {
                assertFalse("made it past before() with eager start", testCase.eagerStart);
            }

            @Override
            protected void preAfter() throws Exception {
            }

            @Override
            protected void postAfter() throws Exception {
            }

            @Override
            protected void use(XvfbController ctrl) throws Exception {