blueReader { public static ByteBuffer initialize() { Log.i(TAG, "initialize blueReader!"); Pref.setInt("bridge_battery", 0); PersistentStore.setDouble("blueReaderFirmwareValue", 0); ByteBuffer ackMessage = ByteBuffer.allocate(3); ackMessage.put(0, (byte) 0x49); ackMessage.put(1, (byte) 0x44); ackMessage.put(2, (byte) 0x4E); return ackMessage; }  static boolean isblueReader(); static byte[] decodeblueReaderPacket(byte[] buffer, int len); static ByteBuffer initialize();  }
@Test public void initialize() { ByteBuffer ackMessage = blueReader.initialize(); assertThat(getLogs()).contains("I/blueReader: initialize blueReader!"); assertThat(Pref.getInt("bridge_battery", -1)).isEqualTo(0); assertThat(PersistentStore.getDouble("blueReaderFirmwareValue")).isWithin(0.0d).of(0d); assertThat(new String(ackMessage.array())).isEqualTo("IDN"); }