### Question:
Utils { public static String getNamespace(String name) { assertNotNull(name, "name may not be null"); String [] parts = name.split("\\:", 2); if(parts.length != 2) { throw new IllegalArgumentException(name + " is not namespaced"); } return parts[0]; } private  Utils(); static String getNamespace(String name); static boolean isNamespaced(String name); static String namespace(String namespace, String name); static void assertNotNull(Object argument); static void assertNotNull(Object argument, Object message); static void assertNotEmpty(String value); static void assertNotEmpty(String value, Object message); static void assertNotEmpty(Map<?,?> map); static void assertNotEmpty(Map<?,?> map,  Object message); static void assertNotEmpty(Collection<?> collection); static void assertNotEmpty(Collection<?> collection,  Object message); static void assertTrue(boolean expression); static void assertTrue(boolean expression, Object message); static void assertFalse(boolean expression); static void assertFalse(boolean expression, Object message); static Map<K, V> unmodifiableCopy(Map<K, V> source); static final String serializeType(Type type); static final Type deserializeType(String type); static String b64Encode(byte[] binary); static byte [] b64Decode(CharSequence encoded); static final byte[] hash(String value); static final byte[] hash(InputStream is); static final String shortHash(InputStream is); @Deprecated static byte[] aesEncrypt(String secretStr, byte[] decrypted); @Deprecated static byte[] aesDecrypt(String secretStr, byte[] encrypted); @Deprecated static String aesEncrypt(String secretStr, String decrypted); @Deprecated static String aesDecrypt(String secretStr, String encrypted); static boolean setIf(String key, Object value, Map<String,Object> map); static Map<String, String> coerceToStringMap(Map<String, ?> value); static String coerceToString(Object value); static String randomTokenString(int length); static final Charset UTF_8; static final Object [] EMPTY_ARRAY; static final byte [] EMPTY_BYTE_ARRAY; }### Answer:
@Test public void testGetNamespace() throws Exception { try { Utils.getNamespace(null); fail("Retrieved a null namespace"); } catch(IllegalArgumentException e) { } try { Utils.getNamespace("notnamespaced"); fail("Retrieved an empty namespace"); } catch(IllegalArgumentException e) { } assertEquals("a", Utils.getNamespace("a:b")); assertEquals("a", Utils.getNamespace("a:b:c")); }