question: private static void verifyDevice ( IDevice d , long mac , Short vlan , Integer ip , long swId , int port ) { assertNotNull ( d ) ; assertEquals ( MacAddress . of ( mac ) , d . getMACAddress ( ) ) ; if ( vlan == null ) assertArrayEquals ( new VlanVid [ ] { VlanVid . ofVlan ( - 1 ) } , d . getVlanId ( ) ) ; else assertArrayEquals ( new VlanVid [ ] { VlanVid . ofVlan ( vlan ) } , d . getVlanId ( ) ) ; if ( ip == null ) assertArrayEquals ( new IPv4Address [ ] { IPv4Address . of ( 0 ) } , d . getIPv4Addresses ( ) ) ; else assertArrayEquals ( new IPv4Address [ ] { IPv4Address . of ( ip ) } , d . getIPv4Addresses ( ) ) ; SwitchPort expectedAp = new SwitchPort ( DatapathId . of ( swId ) , OFPort . of ( port ) ) ; assertArrayEquals ( new SwitchPort [ ] { expectedAp } , d . getAttachmentPoints ( ) ) ; }
target:  Verify that the given device exactly matches the given fields. E.g., if ip is not null we expect the device to have exactly one IP address. swId and port are the attachment point port. Vlan and ip are optional all other fields must be specified.