### Question:
DFSUtil { public static List<InetSocketAddress> getNNServiceRpcAddresses( Configuration conf) throws IOException { String defaultAddress; try { defaultAddress = NameNode.getHostPortString(NameNode.getAddress(conf)); } catch (IllegalArgumentException e) { defaultAddress = null; } List<InetSocketAddress> addressList = getAddresses(conf, defaultAddress, DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, DFS_NAMENODE_RPC_ADDRESS_KEY); if (addressList == null) { throw new IOException("Incorrect configuration: namenode address " + DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY + " or " + DFS_NAMENODE_RPC_ADDRESS_KEY + " is not configured."); } return addressList; }  static Random getRandom(); static boolean isValidName(String src); static String bytes2String(byte[] bytes); static byte[] string2Bytes(String str); static String byteArray2String(byte[][] pathComponents); static byte[][] bytes2byteArray(byte[] bytes, byte separator); static byte[][] bytes2byteArray(byte[] bytes,
                                         int len,
                                         byte separator); static BlockLocation[] locatedBlocks2Locations(LocatedBlocks blocks); static Collection<String> getNameServiceIds(Configuration conf); static List<InetSocketAddress> getBackupNodeAddresses(
      Configuration conf); static List<InetSocketAddress> getSecondaryNameNodeAddresses(
      Configuration conf); static List<InetSocketAddress> getNNServiceRpcAddresses(
      Configuration conf); static String getNameServiceIdFromAddress(Configuration conf, 
      InetSocketAddress address, String... keys); static String getInfoServer(
      InetSocketAddress namenode, Configuration conf, boolean httpsAddress); static boolean isDefaultNamenodeAddress(Configuration conf,
      InetSocketAddress address, String... keys); static String getNameServiceIdKey(String key, String nameserviceId); static void setGenericConf(Configuration conf,
      String nameserviceId, String... keys); static String getNameServiceId(Configuration conf); static float getPercentUsed(long used, long capacity); static float getPercentRemaining(long remaining, long capacity); static InetSocketAddress getSocketAddress(String address); static int roundBytesToGB(long bytes); static ClientProtocol createNamenode(Configuration conf); static ClientProtocol createNamenode( InetSocketAddress nameNodeAddr,
      Configuration conf); static ClientDatanodeProtocol createClientDatanodeProtocolProxy(
      DatanodeID datanodeid, Configuration conf, int socketTimeout,
      LocatedBlock locatedBlock); static final Comparator<DatanodeInfo> DECOM_COMPARATOR; }### Answer:
@Test public void testDefaultNamenode() throws IOException { HdfsConfiguration conf = new HdfsConfiguration(); final String hdfs_default = "hdfs: conf.set(DFSConfigKeys.FS_DEFAULT_NAME_KEY, hdfs_default); List<InetSocketAddress> addrList = DFSUtil.getNNServiceRpcAddresses(conf); assertEquals(1, addrList.size()); assertEquals(9999, addrList.get(0).getPort()); }