// Path: heartbeat-common/src/main/java/com/heartbeat/common/board/OperatingSystem.java
// public final class OperatingSystem {
//     private OperatingSystem() {
//     }
// 
//     private static Type os;
// 
//     /**
//      * Detect the operating system from the os.name System property
//      *
//      * @returns - the operating system
//      */
//     public static Type getType() {
//         return getType(false);
//     }
// 
//     /**
//      * Detect the operating system from the os.name System property
//      *
//      * @returns - the operating system
//      */
//     public static Type getType(boolean force) {
//         if (force || os == null) {
//             String osName = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH);
//             if (osName.contains("nux")) {
//                 OperatingSystem.os = Type.LINUX;
//             } else if (osName.contains("win")) {
//                 OperatingSystem.os = Type.WINDOWS;
//             } else if (osName.contains("mac")) {
//                 OperatingSystem.os = Type.MAC_OS;
//             } else {
//                 OperatingSystem.os = Type.OTHER;
//             }
//         }
//         return os;
//     }
// 
// 
//     /**
//      * Types of Operating Systems and some default values.
//      */
//     public enum Type {
//         WINDOWS(new String[]{"cmd.exe", "/c"}),
//         MAC_OS(new String[]{"bash", "-c"}),
//         LINUX(new String[]{"bash", "-c"}),
//         OTHER(new String[]{"bash", "-c"}); // hope they are linux :D
// 
//         private final String[] cmdPrefix;
// 
//         Type(String[] cmdPrefix) {
//             this.cmdPrefix = cmdPrefix;
//         }
// 
//         /**
//          * returns the pre commands of the OS command line
//          *
//          * @return
//          */
//         public String[] getCmdPrefix() {
//             return Arrays.copyOf(cmdPrefix, 2);
//         }
//     }
// }
// 
// Path: heartbeat-pin/src/main/java/com/heartbeat/pin/command/PinCommandException.java
// public class PinCommandException extends PinException {
// 
//     public PinCommandException(String message) {
//         super(message);
//     }
// 
//     public PinCommandException() {
//     }
// 
//     public PinCommandException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public PinCommandException(Throwable cause) {
//         super(cause);
//     }
// 
//     public PinCommandException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
//         super(message, cause, enableSuppression, writableStackTrace);
//     }
// }


import com.heartbeat.common.board.OperatingSystem;
import com.heartbeat.pin.command.PinCommandException;
import org.junit.Test;
import java.io.File;
        });
        Pin b = new Pin("P1", new File("/sys/class/gpio/gpio/P1/value"), Pin.Mode.IN, new TestPinCommand() {
            @Override
            public Pin.Mode getMode(Pin pin) throws PinCommandException {
                return Pin.Mode.IN;
            }

            @Override
            public boolean read(Pin pin) throws PinCommandException {
                return true;
            }
        });
        assert a.hashCode() == b.hashCode();

    }

    @Test
    public void testToString() throws Exception {
        Pin a = new Pin("P1", new TestPinCommand() {
            @Override
            public Pin.Mode getMode(Pin pin) throws PinCommandException {
                return Pin.Mode.IN;
            }

            @Override
            public boolean read(Pin pin) throws PinCommandException {
                return true;
            }
        });
        String expectedStr = "Pin{code='P1', path=/sample/P1, mode=IN, enabled=true}";
// Path: heartbeat-common/src/main/java/com/heartbeat/common/board/OperatingSystem.java
// public final class OperatingSystem {
//     private OperatingSystem() {
//     }
// 
//     private static Type os;
// 
//     /**
//      * Detect the operating system from the os.name System property
//      *
//      * @returns - the operating system
//      */
//     public static Type getType() {
//         return getType(false);
//     }
// 
//     /**
//      * Detect the operating system from the os.name System property
//      *
//      * @returns - the operating system
//      */
//     public static Type getType(boolean force) {
//         if (force || os == null) {
//             String osName = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH);
//             if (osName.contains("nux")) {
//                 OperatingSystem.os = Type.LINUX;
//             } else if (osName.contains("win")) {
//                 OperatingSystem.os = Type.WINDOWS;
//             } else if (osName.contains("mac")) {
//                 OperatingSystem.os = Type.MAC_OS;
//             } else {
//                 OperatingSystem.os = Type.OTHER;
//             }
//         }
//         return os;
//     }
// 
// 
//     /**
//      * Types of Operating Systems and some default values.
//      */
//     public enum Type {
//         WINDOWS(new String[]{"cmd.exe", "/c"}),
//         MAC_OS(new String[]{"bash", "-c"}),
//         LINUX(new String[]{"bash", "-c"}),
//         OTHER(new String[]{"bash", "-c"}); // hope they are linux :D
// 
//         private final String[] cmdPrefix;
// 
//         Type(String[] cmdPrefix) {
//             this.cmdPrefix = cmdPrefix;
//         }
// 
//         /**
//          * returns the pre commands of the OS command line
//          *
//          * @return
//          */
//         public String[] getCmdPrefix() {
//             return Arrays.copyOf(cmdPrefix, 2);
//         }
//     }
// }
// 
// Path: heartbeat-pin/src/main/java/com/heartbeat/pin/command/PinCommandException.java
// public class PinCommandException extends PinException {
// 
//     public PinCommandException(String message) {
//         super(message);
//     }
// 
//     public PinCommandException() {
//     }
// 
//     public PinCommandException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public PinCommandException(Throwable cause) {
//         super(cause);
//     }
// 
//     public PinCommandException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
//         super(message, cause, enableSuppression, writableStackTrace);
//     }
// }


// Path: heartbeat-pin/src/test/java/com/heartbeat/pin/PinTest.java
import com.heartbeat.common.board.OperatingSystem;
import com.heartbeat.pin.command.PinCommandException;
import org.junit.Test;
import java.io.File;

        });
        Pin b = new Pin("P1", new File("/sys/class/gpio/gpio/P1/value"), Pin.Mode.IN, new TestPinCommand() {
            @Override
            public Pin.Mode getMode(Pin pin) throws PinCommandException {
                return Pin.Mode.IN;
            }

            @Override
            public boolean read(Pin pin) throws PinCommandException {
                return true;
            }
        });
        assert a.hashCode() == b.hashCode();

    }

    @Test
    public void testToString() throws Exception {
        Pin a = new Pin("P1", new TestPinCommand() {
            @Override
            public Pin.Mode getMode(Pin pin) throws PinCommandException {
                return Pin.Mode.IN;
            }

            @Override
            public boolean read(Pin pin) throws PinCommandException {
                return true;
            }
        });
        String expectedStr = "Pin{code='P1', path=/sample/P1, mode=IN, enabled=true}";
        if (OperatingSystem.getType() == OperatingSystem.Type.WINDOWS) {