// 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;
/*
 * Copyright 2015 Hello Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/
package is.hello.buruberi.bluetooth.stacks.util;





public class BytesTests extends BuruberiTestCase {
    @Test
    public void toStringWithBounds() throws Exception {
        final byte[] emptyBytes = {};
        final String emptyString = Bytes.toString(emptyBytes, 0, 0);
        assertEquals("", emptyString);


        final byte[] testBytes = { 0x12, 0x14, 0x0f, 0x12 };
        assertEquals("1214", Bytes.toString(testBytes, 0, 2));
        assertEquals("0F12", Bytes.toString(testBytes, 2, 4));

// 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;

/*
 * Copyright 2015 Hello Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/
package is.hello.buruberi.bluetooth.stacks.util;





public class BytesTests extends BuruberiTestCase {
    @Test
    public void toStringWithBounds() throws Exception {
        final byte[] emptyBytes = {};
        final String emptyString = Bytes.toString(emptyBytes, 0, 0);
        assertEquals("", emptyString);


        final byte[] testBytes = { 0x12, 0x14, 0x0f, 0x12 };
        assertEquals("1214", Bytes.toString(testBytes, 0, 2));
        assertEquals("0F12", Bytes.toString(testBytes, 2, 4));

        assertThrows(new AssertExtensions.ThrowingRunnable() {