### Question:
IPNetworkRang { public static Integer numberOfNodesToMask(Integer numOfNodes) { return Integer.parseInt(((Integer) (32 - ((Double) (Math.log(numOfNodes) / Math.log(2))) .intValue())).toString()); }  static Integer masktoNumberOfNodes(Integer mask); static Integer numberOfNodesToMask(Integer numOfNodes); static IPAddress transformIntegerMaskToIPMask(Integer mask); static List<IPAddress> calculateWholeRange(IPAddress networkAddress, Integer mask); static Integer transformIPMaskToIntegerMask(IPAddress ipAddress); static IPAddress lastIPAddressWithNumNodes(IPAddress networkAddress,
        Integer numberOfNodes);  }### Answer:
@Test public void testNumberOfNodesToMask() { assertEquals((Integer) 32, IPNetworkRang.numberOfNodesToMask(1)); assertEquals((Integer) 24, IPNetworkRang.numberOfNodesToMask(256)); assertEquals((Integer) 16, IPNetworkRang.numberOfNodesToMask(65536)); assertEquals((Integer) 8, IPNetworkRang.numberOfNodesToMask(16777216)); assertEquals((Integer) 2, IPNetworkRang.numberOfNodesToMask(2147483647)); }