// Path: src/main/java/org/sputnikdev/bluetooth/manager/BluetoothInteractionException.java
// public class BluetoothInteractionException extends RuntimeException {
// 
//     public BluetoothInteractionException() { }
// 
//     public BluetoothInteractionException(String message) {
//         super(message);
//     }
// 
//     public BluetoothInteractionException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: src/main/java/org/sputnikdev/bluetooth/manager/BluetoothObjectType.java
// public enum BluetoothObjectType {
// 
//     ADAPTER,
//     DEVICE,
//     CHARACTERISTIC
// 
// }
// 
// Path: src/main/java/org/sputnikdev/bluetooth/manager/BluetoothObjectVisitor.java
// public interface BluetoothObjectVisitor {
// 
//     void visit(AdapterGovernor governor) throws Exception;
// 
//     void visit(DeviceGovernor governor) throws Exception;
// 
//     void visit(CharacteristicGovernor governor) throws Exception;
// 
// }
// 
// Path: src/main/java/org/sputnikdev/bluetooth/manager/GovernorListener.java
// @FunctionalInterface
// public interface GovernorListener {
// 
//     /**
//      * Reports when a device/governor changes its status. See {@link BluetoothGovernor} for more info.
//      * @param isReady true if a device/adapter becomes ready for interactions (hardware acquired), false otherwise
//      */
//     void ready(boolean isReady);
// 
//     /**
//      * Reports when a device/governor was last active (receiving events, sending commands etc).
//      * @param lastActivity a date when a device was last active
//      */
//     default void lastUpdatedChanged(Instant lastActivity) { }
// 
// }
// 
// Path: src/main/java/org/sputnikdev/bluetooth/manager/transport/BluetoothObject.java
// public interface BluetoothObject {
// 
//     URL getURL();
// 
// }


import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InOrder;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Spy;
import org.mockito.internal.util.reflection.Whitebox;
import org.mockito.runners.MockitoJUnitRunner;
import org.sputnikdev.bluetooth.URL;
import org.sputnikdev.bluetooth.manager.BluetoothInteractionException;
import org.sputnikdev.bluetooth.manager.BluetoothObjectType;
import org.sputnikdev.bluetooth.manager.BluetoothObjectVisitor;
import org.sputnikdev.bluetooth.manager.GovernorListener;
import org.sputnikdev.bluetooth.manager.transport.BluetoothObject;
import java.time.Instant;
import java.util.function.Function;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import static org.powermock.api.mockito.PowerMockito.spy;
        @Override
        public boolean isUpdatable() {
            return true;
        }

        @Override void reset(BluetoothObject object) {
        }

        @Override void update(BluetoothObject object) {
        }

        @Override void init(BluetoothObject object) {
        }

        @Override public BluetoothObjectType getType() {
            return BluetoothObjectType.ADAPTER;
        }

        @Override public void accept(BluetoothObjectVisitor visitor) throws Exception {
        }
    };

    @Before
    public void setUp() {
        when(bluetoothObject.getURL()).thenReturn(URL.copyWithProtocol("tinyb"));
        when(bluetoothManager.getBluetoothObject(URL)).thenReturn(bluetoothObject);

        MockUtils.mockImplicitNotifications(bluetoothManager);
    }

// Path: src/main/java/org/sputnikdev/bluetooth/manager/BluetoothInteractionException.java
// public class BluetoothInteractionException extends RuntimeException {
// 
//     public BluetoothInteractionException() { }
// 
//     public BluetoothInteractionException(String message) {
//         super(message);
//     }
// 
//     public BluetoothInteractionException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: src/main/java/org/sputnikdev/bluetooth/manager/BluetoothObjectType.java
// public enum BluetoothObjectType {
// 
//     ADAPTER,
//     DEVICE,
//     CHARACTERISTIC
// 
// }
// 
// Path: src/main/java/org/sputnikdev/bluetooth/manager/BluetoothObjectVisitor.java
// public interface BluetoothObjectVisitor {
// 
//     void visit(AdapterGovernor governor) throws Exception;
// 
//     void visit(DeviceGovernor governor) throws Exception;
// 
//     void visit(CharacteristicGovernor governor) throws Exception;
// 
// }
// 
// Path: src/main/java/org/sputnikdev/bluetooth/manager/GovernorListener.java
// @FunctionalInterface
// public interface GovernorListener {
// 
//     /**
//      * Reports when a device/governor changes its status. See {@link BluetoothGovernor} for more info.
//      * @param isReady true if a device/adapter becomes ready for interactions (hardware acquired), false otherwise
//      */
//     void ready(boolean isReady);
// 
//     /**
//      * Reports when a device/governor was last active (receiving events, sending commands etc).
//      * @param lastActivity a date when a device was last active
//      */
//     default void lastUpdatedChanged(Instant lastActivity) { }
// 
// }
// 
// Path: src/main/java/org/sputnikdev/bluetooth/manager/transport/BluetoothObject.java
// public interface BluetoothObject {
// 
//     URL getURL();
// 
// }


// Path: src/test/java/org/sputnikdev/bluetooth/manager/impl/AbstractBluetoothObjectGovernorTest.java
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InOrder;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Spy;
import org.mockito.internal.util.reflection.Whitebox;
import org.mockito.runners.MockitoJUnitRunner;
import org.sputnikdev.bluetooth.URL;
import org.sputnikdev.bluetooth.manager.BluetoothInteractionException;
import org.sputnikdev.bluetooth.manager.BluetoothObjectType;
import org.sputnikdev.bluetooth.manager.BluetoothObjectVisitor;
import org.sputnikdev.bluetooth.manager.GovernorListener;
import org.sputnikdev.bluetooth.manager.transport.BluetoothObject;
import java.time.Instant;
import java.util.function.Function;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import static org.powermock.api.mockito.PowerMockito.spy;

        @Override
        public boolean isUpdatable() {
            return true;
        }

        @Override void reset(BluetoothObject object) {
        }

        @Override void update(BluetoothObject object) {
        }

        @Override void init(BluetoothObject object) {
        }

        @Override public BluetoothObjectType getType() {
            return BluetoothObjectType.ADAPTER;
        }

        @Override public void accept(BluetoothObjectVisitor visitor) throws Exception {
        }
    };

    @Before
    public void setUp() {
        when(bluetoothObject.getURL()).thenReturn(URL.copyWithProtocol("tinyb"));
        when(bluetoothManager.getBluetoothObject(URL)).thenReturn(bluetoothObject);

        MockUtils.mockImplicitNotifications(bluetoothManager);
    }

    @Test(expected = BluetoothInteractionException.class)