### Question:
WiFiDevice extends IPDevice { public Inet4Address getIPAddressMask() throws TimeoutException, XBeeException { try { return (Inet4Address) Inet4Address.getByAddress(getParameter("MK")); } catch (UnknownHostException e) { throw new XBeeException(e); } } WiFiDevice(String port, int baudRate);  WiFiDevice(String port, int baudRate, int dataBits, int stopBits, int parity, int flowControl);  WiFiDevice(String port, SerialPortParameters serialPortParameters);  WiFiDevice(IConnectionInterface connectionInterface); @Override void open(); @Override XBeeProtocol getXBeeProtocol(); WiFiAssociationIndicationStatus getWiFiAssociationIndicationStatus(); AccessPoint getAccessPoint(String ssid); List<AccessPoint> scanAccessPoints(); boolean connect(String ssid, String password); boolean connect(AccessPoint accessPoint, String password); boolean disconnect(); boolean isConnected(); int getAccessPointTimeout(); void setAccessPointTimeout(int accessPointTimeout); void setIPAddressingMode(IPAddressingMode mode); IPAddressingMode getIPAddressingMode(); void setIPAddress(Inet4Address address); void setIPAddressMask(Inet4Address address); Inet4Address getIPAddressMask(); void setGatewayIPAddress(Inet4Address address); Inet4Address getGatewayIPAddress(); void setDNSAddress(Inet4Address address); Inet4Address getDNSAddress();  }### Answer:
@Test public void testGetIPAddressMaskIllegalIP() throws XBeeException { Mockito.doReturn(new byte[]{0x00}).when(wifiDevice).getParameter(PARAMETER_MK); try { wifiDevice.getIPAddressMask(); fail(); } catch (XBeeException e) { assertEquals("Exception is not caused by an UnknownHostException", e.getCause().getClass(), UnknownHostException.class); } }
@Test public void testGetIPAddressMask() throws Exception { Mockito.doReturn(IP_ADDRESS).when(wifiDevice).getParameter(PARAMETER_MK); assertEquals(Inet4Address.getByAddress(IP_ADDRESS), wifiDevice.getIPAddressMask()); }