### Question:
ServerUtils { public static File getOzoneMetaDirPath(ConfigurationSource conf) { File dirPath = getDirectoryFromConfig(conf, HddsConfigKeys.OZONE_METADATA_DIRS, "Ozone"); if (dirPath == null) { throw new IllegalArgumentException( HddsConfigKeys.OZONE_METADATA_DIRS + " must be defined."); } return dirPath; } private  ServerUtils(); static long sanitizeUserArgs(String key, long valueTocheck,
      String baseKey, long baseValue, long minFactor, long maxFactor); static InetSocketAddress updateRPCListenAddress(
      OzoneConfiguration conf, String rpcAddressKey,
      InetSocketAddress addr, RPC.Server rpcServer); static InetSocketAddress updateListenAddress(OzoneConfiguration conf,
      String addressKey, InetSocketAddress addr, InetSocketAddress listenAddr); static void releaseConnection(HttpRequestBase request); static File getScmDbDir(ConfigurationSource conf); static File getDirectoryFromConfig(ConfigurationSource conf,
                                            String key,
                                            String componentName); static File getOzoneMetaDirPath(ConfigurationSource conf); static void setOzoneMetaDirPath(OzoneConfiguration conf,
      String path); static File getDBPath(ConfigurationSource conf, String key); static String getRemoteUserName(); static String getDefaultRatisDirectory(ConfigurationSource conf);  }### Answer:
@Test public void ozoneMetadataDirIsMandatory() { thrown.expect(IllegalArgumentException.class); ServerUtils.getOzoneMetaDirPath(new OzoneConfiguration()); }
@Test public void ozoneMetadataDirAcceptsSingleItem() { final File testDir = PathUtils.getTestDir(TestServerUtils.class); final File metaDir = new File(testDir, "metaDir"); final OzoneConfiguration conf = new OzoneConfiguration(); conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, metaDir.getPath()); try { assertFalse(metaDir.exists()); assertEquals(metaDir, ServerUtils.getOzoneMetaDirPath(conf)); assertTrue(metaDir.exists()); } finally { FileUtils.deleteQuietly(metaDir); } }
@Test public void ozoneMetadataDirRejectsList() { final OzoneConfiguration conf = new OzoneConfiguration(); conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, "/data/meta1,/data/meta2"); thrown.expect(IllegalArgumentException.class); ServerUtils.getOzoneMetaDirPath(conf); }