KnxEncoder { public static String convertDeviceAddressToHex(String address) { String source = "0000"; String vectorAddress[] = address.split("[.]"); int xInt = Integer.parseInt(vectorAddress[0]); int yInt = Integer.parseInt(vectorAddress[1]); int highInt = 0; int zInt = Integer.parseInt(vectorAddress[2]); xInt = xInt & 0xf; yInt = yInt & 0xf; xInt <<= 4; highInt = xInt + yInt; String highHex = Integer.toHexString(highInt); if (highInt < 16) highHex = "0" + highHex; String lowHex = Integer.toHexString(zInt); if (zInt < 16) lowHex = "0" + lowHex; source = highHex + lowHex; return source; }  static byte[] encode(boolean repeatBit, byte[] sourceByte, String targetAddress, byte[] dataByte,
			KnxCommand commandType, boolean multicast); static KnxTelegram decode(byte knxMessage[]); static byte[] removeTrailingZeros(byte[] original); static String convertDeviceAddressToHex(String address); static String convertGroupAddressToHex(String address); static byte[] convertToByteArray(String hexString); static String convertToReadableHex(byte[] b); static String convertToHex(byte[] b); static String convertGroupAddressToReadable(byte buffer[]); static String clearHexValue(String hexValue);  }
@Test public void createAddressTest() { assertTrue( "KnxEncoder.createAddress('1.2.3') returns " + KnxEncoder.convertDeviceAddressToHex("1.2.3") + "; but should return 1203", KnxEncoder.convertDeviceAddressToHex("1.2.3").equalsIgnoreCase("1203")); assertTrue( "KnxEncoder.createAddress('15.14.234') returns " + KnxEncoder.convertDeviceAddressToHex("15.14.234") + "; but should return feea", KnxEncoder.convertDeviceAddressToHex("15.14.234").equalsIgnoreCase("feea")); }