### Question:
DriverConnection implements Connection { @Override public List<ChannelScanInfo> scanForChannels(String settings) throws UnsupportedOperationException, ConnectionException { synchronized (serialInterface) { List<ChannelScanInfo> chanScanInf = new ArrayList<>(); try { MBusConnection mBusConnection = serialInterface.getMBusConnection(); if (secondaryAddress != null) { mBusConnection.selectComponent(secondaryAddress); } else { mBusConnection.linkReset(mBusAddress); } sleep(delay); VariableDataStructure variableDataStructure = mBusConnection.read(mBusAddress); List<DataRecord> dataRecords = variableDataStructure.getDataRecords(); for (DataRecord dataRecord : dataRecords) { String vib = Helper.bytesToHex(dataRecord.getVib()); String dib = Helper.bytesToHex(dataRecord.getDib()); ValueType valueType; Integer valueLength; switch (dataRecord.getDataValueType()) { case STRING: valueType = ValueType.STRING; valueLength = 25; break; case LONG: if (dataRecord.getMultiplierExponent() == 0) { valueType = ValueType.LONG; } else { valueType = ValueType.DOUBLE; } valueLength = null; break; case DOUBLE: case DATE: valueType = ValueType.DOUBLE; valueLength = null; break; case BCD: if (dataRecord.getMultiplierExponent() == 0) { valueType = ValueType.DOUBLE; } else { valueType = ValueType.LONG; } valueLength = null; break; case NONE: default: valueType = ValueType.BYTE_ARRAY; valueLength = 100; break; } String unit = ""; if (dataRecord.getUnit() != null) { unit = dataRecord.getUnit().getUnit(); } chanScanInf.add(new ChannelScanInfo(dib + ":" + vib, getDescription(dataRecord), valueType, valueLength, true, true, "", unit)); } } catch (SerialPortTimeoutException e) { throw new ConnectionException("Scan timeout."); } catch (IOException e) { throw new ConnectionException(e); } return chanScanInf; } } DriverConnection(ConnectionInterface serialInterface, int mBusAddress, SecondaryAddress secondaryAddress); @Override List<ChannelScanInfo> scanForChannels(String settings); @Override void disconnect(); @Override Object read(List<ChannelRecordContainer> containers, Object containerListHandle, String samplingGroup); @Override void startListening(List<ChannelRecordContainer> containers, RecordsReceivedListener listener); @Override Object write(List<ChannelValueContainer> containers, Object containerListHandle);  }### Answer:
@Test public void testScanForChannels() throws Exception { DriverConnection mBusConnection = newConnection("/dev/ttyS100:5"); assertEquals(ValueType.LONG, mBusConnection.scanForChannels(null).get(0).getValueType()); }