public boolean inRange(MacAddress macAddr, MacAddress maskAddr) {
        byte[] min = macAddr.toBytes();
        byte[] mask = maskAddr.toBytes();
        boolean inRange = true;

        int i = 0;

        //if mask is 00 stop
        while (inRange && i < mask.length && (mask[i] & 0xFF) != 0) {
            int ibmac = this.address[i] & 0xFF;
            int ibmin = min[i] & 0xFF;
            int ibmask = mask[i] & 0xFF;
            if (ibmask == 255) {
                inRange = ibmac == ibmin;
            } else if (ibmac < ibmin || ibmac >= ibmask) {
                inRange = false;
                break;
            }
            i++;
        }

        return inRange;
    }
@Test
    public void testContained() throws Exception {
        assertFalse(MAC_NORMAL.inRange(MAC_IPV4_MCAST, MAC_IPV4_MCAST_MASK));
        assertFalse(MAC_NORMAL.inRange(MAC_IPV6_MCAST, MAC_IPV6_MCAST_MASK));
        // Contained in itself
        assertTrue(MAC_IPV4_MCAST.inRange(MAC_IPV4_MCAST, MAC_IPV4_MCAST_MASK));
        assertTrue(MAC_IPV6_MCAST.inRange(MAC_IPV6_MCAST, MAC_IPV6_MCAST_MASK));
        // Verify the mcast addresses
        assertTrue(MAC_IPV4_MCAST_ADDR.inRange(MAC_IPV4_MCAST, MAC_IPV4_MCAST_MASK));
        assertTrue(MAC_IPV6_MCAST_ADDR.inRange(MAC_IPV6_MCAST, MAC_IPV6_MCAST_MASK));
    }