### Question:
MetastoreClientUtils { public static boolean makeDirs(Warehouse wh, Path path) throws MetaException { checkNotNull(wh, "Warehouse cannot be null"); checkNotNull(path, "Path cannot be null"); boolean madeDir = false; if (!wh.isDir(path)) { if (!wh.mkdirs(path, true)) { throw new MetaException("Unable to create path: " + path); } madeDir = true; } return madeDir; } private  MetastoreClientUtils(); static boolean makeDirs(Warehouse wh, Path path); static void validateTableObject(Table table, Configuration conf); static void validateGlueTable(com.amazonaws.services.glue.model.Table table); static Map<K, V> deepCopyMap(Map<K, V> originalMap); static boolean isExternalTable(org.apache.hadoop.hive.metastore.api.Table table); static String getCatalogId(Configuration conf);  }### Answer:
@Test(expected = NullPointerException.class) public void testMakeDirsNullWh() throws Exception { MetastoreClientUtils.makeDirs(null, testPath); }
@Test(expected = NullPointerException.class) public void testMakeDirsNullPath() throws Exception { MetastoreClientUtils.makeDirs(wh, null); }
@Test public void testMakeDirsAlreadyExists() throws Exception { when(wh.isDir(testPath)).thenReturn(true); assertFalse(MetastoreClientUtils.makeDirs(wh, testPath)); }
@Test(expected = MetaException.class) public void testMakeDirsCannotCreateDir() throws Exception { when(wh.isDir(testPath)).thenReturn(false); when(wh.mkdirs(testPath, true)).thenReturn(false); MetastoreClientUtils.makeDirs(wh, testPath); }