private static void verifyDevice(IDevice d,MacAddress mac,VlanVid vlan,IPv4Address ipv4,IPv6Address ipv6,DatapathId swId,OFPort port){
  assertNotNull(d);
  if (!mac.equals(MacAddress.NONE)) {
    assertEquals(mac,d.getMACAddress());
  }
  if (vlan != null) {
    assertArrayEquals(new VlanVid[]{vlan},d.getVlanId());
  }
  if (!ipv4.equals(IPv4Address.NONE)) {
    assertArrayEquals(new IPv4Address[]{ipv4},d.getIPv4Addresses());
  }
  if (!ipv6.equals(IPv6Address.NONE)) {
    assertArrayEquals(new IPv6Address[]{ipv6},d.getIPv6Addresses());
  }
  if (!swId.equals(DatapathId.NONE) && !port.equals(OFPort.ZERO)) {
    SwitchPort expectedAp=new SwitchPort(swId,port);
    assertArrayEquals(new SwitchPort[]{expectedAp},d.getAttachmentPoints());
  }
}

private static void verifyDevice ( IDevice d , MacAddress mac , VlanVid vlan , IPv4Address ipv4 , IPv6Address ipv6 , DatapathId swId , OFPort port ) { assertNotNull ( d ) ; if ( ! mac . equals ( MacAddress . NONE ) ) { assertEquals ( mac , d . getMACAddress ( ) ) ; } if ( vlan != null ) { assertArrayEquals ( new VlanVid [ ] { vlan } , d . getVlanId ( ) ) ; } if ( ! ipv4 . equals ( IPv4Address . NONE ) ) { assertArrayEquals ( new IPv4Address [ ] { ipv4 } , d . getIPv4Addresses ( ) ) ; } if ( ! ipv6 . equals ( IPv6Address . NONE ) ) { assertArrayEquals ( new IPv6Address [ ] { ipv6 } , d . getIPv6Addresses ( ) ) ; } if ( ! swId . equals ( DatapathId . NONE ) && ! port . equals ( OFPort . ZERO ) ) { SwitchPort expectedAp = new SwitchPort ( swId , 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 .
