public static String getBroadcastAddr(String ipAddr, int prefixLength) {
        String subnet = ipAddr + "/" + prefixLength;
        SubnetUtils utils = new SubnetUtils(subnet);
        return utils.getInfo().getBroadcastAddress();
    }
@Test
    public void testGetBroadcastAddr() {
        String ipAddr = "192.168.10.35";
        int prefix1 = 24;
        String broadcast1 = getBroadcastAddr(ipAddr, prefix1);
        assertEquals(broadcast1, "192.168.10.255");

        int prefix2 = 28;
        String broadcast2 = getBroadcastAddr(ipAddr, prefix2);
        assertEquals(broadcast2, "192.168.10.47");

        int prefix3 = 32;
        String broadcast3 = getBroadcastAddr(ipAddr, prefix3);
        assertEquals(broadcast3, "192.168.10.35");

        int prefix4 = 16;
        String broadcast4 = getBroadcastAddr(ipAddr, prefix4);
        assertEquals(broadcast4, "192.168.255.255");
    }