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());
}

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 ( ) ) ; }
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 .
