// Path: buruberi-core/src/test/java/is/hello/buruberi/testing/AssertExtensions.java
// public class AssertExtensions {
//     /**
//      * Checks that a given {@link ThrowingRunnable} throws an exception, calling fail if it does not.
//      * @param runnable  The runnable that should throw an exception. Required.
//      */
//     public static void assertThrows(@NonNull ThrowingRunnable runnable) {
//         try {
//             runnable.run();
//         } catch (Throwable e) {
//             return;
//         }
// 
//         Assert.fail("expected exception, got none");
//     }
// 
//     /**
//      * Variant of the Runnable interface that throws a generic checked exception.
//      */
//     public interface ThrowingRunnable {
//         void run() throws Exception;
//     }
// }
// 
// Path: buruberi-core/src/test/java/is/hello/buruberi/testing/BuruberiTestCase.java
// @RunWith(RobolectricGradleTestRunner.class)
// @Config(constants = BuildConfig.class,
//         sdk = 21,
//         shadows = {
//                 ShadowBluetoothManager.class,
//                 ShadowBluetoothAdapterExt.class,
//                 ShadowBluetoothLeScanner.class,
//                 ShadowBluetoothGatt.class,
//                 ShadowBluetoothDeviceExt.class,
//         })
// public abstract class BuruberiTestCase {
//     protected BuruberiTestCase() {
//         final Context baseContext = RuntimeEnvironment.application.getBaseContext();
//         BuruberiShadows.setUpSystemServices(baseContext);
//     }
// 
//     @Before
//     public void setUp() {
//         ShadowBluetoothAdapterExt shadowBluetoothAdapter = getShadowBluetoothAdapter();
//         shadowBluetoothAdapter.setState(BluetoothAdapter.STATE_ON);
//         shadowBluetoothAdapter.setEnabled(true);
//     }
// 
//     @After
//     public void tearDown() {
//         ShadowBluetoothManager shadowBluetoothManager = getShadowBluetoothManager();
//         shadowBluetoothManager.clearConnectionStates();
//         shadowBluetoothManager.setAdapter(BluetoothAdapter.getDefaultAdapter());
//     }
// 
//     protected Context getContext() {
//         return RuntimeEnvironment.application.getApplicationContext();
//     }
// 
//     protected ShadowBluetoothManager getShadowBluetoothManager() {
//         BluetoothManager bluetoothManager = (BluetoothManager) getContext().getSystemService(Context.BLUETOOTH_SERVICE);
//         return BuruberiShadows.shadowOf(bluetoothManager);
//     }
// 
//     protected ShadowBluetoothAdapterExt getShadowBluetoothAdapter() {
//         return BuruberiShadows.shadowOf(BluetoothAdapter.getDefaultAdapter());
//     }
// }
// 
// Path: buruberi-core/src/test/java/is/hello/buruberi/testing/AssertExtensions.java
// public static void assertThrows(@NonNull ThrowingRunnable runnable) {
//     try {
//         runnable.run();
//     } catch (Throwable e) {
//         return;
//     }
// 
//     Assert.fail("expected exception, got none");
// }


import org.junit.Test;
import java.util.Arrays;
import is.hello.buruberi.testing.AssertExtensions;
import is.hello.buruberi.testing.BuruberiTestCase;
import static is.hello.buruberi.testing.AssertExtensions.assertThrows;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
        assertThrows(new AssertExtensions.ThrowingRunnable() {
            @SuppressWarnings("ResultOfMethodCallIgnored")
            @Override
            public void run() throws Exception {
                Bytes.toString(emptyBytes, 0, 1);
            }
        });
        assertThrows(new AssertExtensions.ThrowingRunnable() {
            @SuppressWarnings("ResultOfMethodCallIgnored")
            @Override
            public void run() throws Exception {
                Bytes.toString(testBytes, 3, 2);
            }
        });
    }

    @Test
    public void toStringWithoutBounds() throws Exception {
        byte[] emptyBytes = {};
        String emptyString = Bytes.toString(emptyBytes);
        assertEquals("", emptyString);


        byte[] testBytes = { 0x12, 0x14, 0x0f, 0x12 };
        String testString = Bytes.toString(testBytes);
        assertEquals("12140F12", testString);
    }

    @Test
    public void fromString() throws Exception {
// Path: buruberi-core/src/test/java/is/hello/buruberi/testing/AssertExtensions.java
// public class AssertExtensions {
//     /**
//      * Checks that a given {@link ThrowingRunnable} throws an exception, calling fail if it does not.
//      * @param runnable  The runnable that should throw an exception. Required.
//      */
//     public static void assertThrows(@NonNull ThrowingRunnable runnable) {
//         try {
//             runnable.run();
//         } catch (Throwable e) {
//             return;
//         }
// 
//         Assert.fail("expected exception, got none");
//     }
// 
//     /**
//      * Variant of the Runnable interface that throws a generic checked exception.
//      */
//     public interface ThrowingRunnable {
//         void run() throws Exception;
//     }
// }
// 
// Path: buruberi-core/src/test/java/is/hello/buruberi/testing/BuruberiTestCase.java
// @RunWith(RobolectricGradleTestRunner.class)
// @Config(constants = BuildConfig.class,
//         sdk = 21,
//         shadows = {
//                 ShadowBluetoothManager.class,
//                 ShadowBluetoothAdapterExt.class,
//                 ShadowBluetoothLeScanner.class,
//                 ShadowBluetoothGatt.class,
//                 ShadowBluetoothDeviceExt.class,
//         })
// public abstract class BuruberiTestCase {
//     protected BuruberiTestCase() {
//         final Context baseContext = RuntimeEnvironment.application.getBaseContext();
//         BuruberiShadows.setUpSystemServices(baseContext);
//     }
// 
//     @Before
//     public void setUp() {
//         ShadowBluetoothAdapterExt shadowBluetoothAdapter = getShadowBluetoothAdapter();
//         shadowBluetoothAdapter.setState(BluetoothAdapter.STATE_ON);
//         shadowBluetoothAdapter.setEnabled(true);
//     }
// 
//     @After
//     public void tearDown() {
//         ShadowBluetoothManager shadowBluetoothManager = getShadowBluetoothManager();
//         shadowBluetoothManager.clearConnectionStates();
//         shadowBluetoothManager.setAdapter(BluetoothAdapter.getDefaultAdapter());
//     }
// 
//     protected Context getContext() {
//         return RuntimeEnvironment.application.getApplicationContext();
//     }
// 
//     protected ShadowBluetoothManager getShadowBluetoothManager() {
//         BluetoothManager bluetoothManager = (BluetoothManager) getContext().getSystemService(Context.BLUETOOTH_SERVICE);
//         return BuruberiShadows.shadowOf(bluetoothManager);
//     }
// 
//     protected ShadowBluetoothAdapterExt getShadowBluetoothAdapter() {
//         return BuruberiShadows.shadowOf(BluetoothAdapter.getDefaultAdapter());
//     }
// }
// 
// Path: buruberi-core/src/test/java/is/hello/buruberi/testing/AssertExtensions.java
// public static void assertThrows(@NonNull ThrowingRunnable runnable) {
//     try {
//         runnable.run();
//     } catch (Throwable e) {
//         return;
//     }
// 
//     Assert.fail("expected exception, got none");
// }


// Path: buruberi-core/src/test/java/is/hello/buruberi/bluetooth/stacks/util/BytesTests.java
import org.junit.Test;
import java.util.Arrays;
import is.hello.buruberi.testing.AssertExtensions;
import is.hello.buruberi.testing.BuruberiTestCase;
import static is.hello.buruberi.testing.AssertExtensions.assertThrows;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

        assertThrows(new AssertExtensions.ThrowingRunnable() {
            @SuppressWarnings("ResultOfMethodCallIgnored")
            @Override
            public void run() throws Exception {
                Bytes.toString(emptyBytes, 0, 1);
            }
        });
        assertThrows(new AssertExtensions.ThrowingRunnable() {
            @SuppressWarnings("ResultOfMethodCallIgnored")
            @Override
            public void run() throws Exception {
                Bytes.toString(testBytes, 3, 2);
            }
        });
    }

    @Test
    public void toStringWithoutBounds() throws Exception {
        byte[] emptyBytes = {};
        String emptyString = Bytes.toString(emptyBytes);
        assertEquals("", emptyString);


        byte[] testBytes = { 0x12, 0x14, 0x0f, 0x12 };
        String testString = Bytes.toString(testBytes);
        assertEquals("12140F12", testString);
    }

    @Test
    public void fromString() throws Exception {
        byte[] emptyBytes = {};