### Question:
WiFiDevice extends IPDevice { public void setIPAddress(Inet4Address address) throws TimeoutException, XBeeException { if (address == null) throw new NullPointerException("IP address cannot be null."); setParameter("MY", address.getAddress()); } 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 testSetIPAddressNull() throws Exception { exception.expect(NullPointerException.class); exception.expectMessage(is(equalTo("IP address cannot be null."))); wifiDevice.setIPAddress(null); }
@Test public void testSetIPAddress() throws Exception { Mockito.doNothing().when(wifiDevice).setParameter(Mockito.eq(PARAMETER_MY), Mockito.any(byte[].class)); wifiDevice.setIPAddress((Inet4Address) Inet4Address.getByAddress(IP_ADDRESS)); }