// Path: src/main/java/org/tyrannyofheaven/bukkit/util/uuid/UuidUtils.java
// public static String longUuidToShort(String uuidString) {
//     if (uuidString.length() != 36)
//         throw new IllegalArgumentException("Wrong length");
//     return uuidString.replaceAll("-", "");
// }
// 
// Path: src/main/java/org/tyrannyofheaven/bukkit/util/uuid/UuidUtils.java
// public static UuidDisplayName parseUuidDisplayName(String name) {
//     Matcher m = UUID_NAME_RE.matcher(name);
//     if (m.matches()) {
//         String uuidString = m.group(1);
//         String displayName = m.group(2);
//             
//         if (uuidString.length() == 32)
//             uuidString = shortUuidToLong(uuidString);
//         UUID uuid;
//         try {
//             uuid = UUID.fromString(uuidString);
//         }
//         catch (IllegalArgumentException e) {
//             return null;
//         }
//         return new UuidDisplayName(uuid, displayName);
//     }
//     return null;
// }
// 
// Path: src/main/java/org/tyrannyofheaven/bukkit/util/uuid/UuidUtils.java
// public static String shortUuidToLong(String uuidString) {
//     if (uuidString.length() != 32)
//         throw new IllegalArgumentException("Wrong length");
//     return uuidString.substring(0, 8) + "-" + uuidString.substring(8, 12) + "-" + uuidString.substring(12, 16) + "-" + uuidString.substring(16, 20) + "-" + uuidString.substring(20, 32);
// }


import static junit.framework.Assert.assertNotNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.tyrannyofheaven.bukkit.util.uuid.UuidUtils.longUuidToShort;
import static org.tyrannyofheaven.bukkit.util.uuid.UuidUtils.parseUuidDisplayName;
import static org.tyrannyofheaven.bukkit.util.uuid.UuidUtils.shortUuidToLong;
import java.util.UUID;
import org.junit.Test;
package org.tyrannyofheaven.bukkit.util.uuid;




public class UuidTest {

    @Test
    public void testConversion() {
        UUID uuid = UUID.randomUUID();
        assertEquals(uuid.toString(), shortUuidToLong(longUuidToShort(uuid.toString())));
    }

    @Test
    public void testNoMatch() {
        UuidDisplayName udn = parseUuidDisplayName("ZerothAngel");
        assertNull(udn);
    }

    @Test
    public void testLongUuidMatchNoName() {
        UUID uuid = UUID.randomUUID();
        UuidDisplayName udn = parseUuidDisplayName(uuid.toString());
        assertNotNull(udn);
        assertEquals(uuid, udn.getUuid());
        assertNull(udn.getDisplayName());
    }

    @Test
    public void testShortUuidMatchNoName() {
        UUID uuid = UUID.randomUUID();
        UuidDisplayName udn = parseUuidDisplayName(longUuidToShort(uuid.toString()));
        assertNotNull(udn);
        assertEquals(uuid, udn.getUuid());
// Path: src/main/java/org/tyrannyofheaven/bukkit/util/uuid/UuidUtils.java
// public static String longUuidToShort(String uuidString) {
//     if (uuidString.length() != 36)
//         throw new IllegalArgumentException("Wrong length");
//     return uuidString.replaceAll("-", "");
// }
// 
// Path: src/main/java/org/tyrannyofheaven/bukkit/util/uuid/UuidUtils.java
// public static UuidDisplayName parseUuidDisplayName(String name) {
//     Matcher m = UUID_NAME_RE.matcher(name);
//     if (m.matches()) {
//         String uuidString = m.group(1);
//         String displayName = m.group(2);
//             
//         if (uuidString.length() == 32)
//             uuidString = shortUuidToLong(uuidString);
//         UUID uuid;
//         try {
//             uuid = UUID.fromString(uuidString);
//         }
//         catch (IllegalArgumentException e) {
//             return null;
//         }
//         return new UuidDisplayName(uuid, displayName);
//     }
//     return null;
// }
// 
// Path: src/main/java/org/tyrannyofheaven/bukkit/util/uuid/UuidUtils.java
// public static String shortUuidToLong(String uuidString) {
//     if (uuidString.length() != 32)
//         throw new IllegalArgumentException("Wrong length");
//     return uuidString.substring(0, 8) + "-" + uuidString.substring(8, 12) + "-" + uuidString.substring(12, 16) + "-" + uuidString.substring(16, 20) + "-" + uuidString.substring(20, 32);
// }


// Path: src/test/java/org/tyrannyofheaven/bukkit/util/uuid/UuidTest.java
import static junit.framework.Assert.assertNotNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.tyrannyofheaven.bukkit.util.uuid.UuidUtils.longUuidToShort;
import static org.tyrannyofheaven.bukkit.util.uuid.UuidUtils.parseUuidDisplayName;
import static org.tyrannyofheaven.bukkit.util.uuid.UuidUtils.shortUuidToLong;
import java.util.UUID;
import org.junit.Test;

package org.tyrannyofheaven.bukkit.util.uuid;




public class UuidTest {

    @Test
    public void testConversion() {
        UUID uuid = UUID.randomUUID();
        assertEquals(uuid.toString(), shortUuidToLong(longUuidToShort(uuid.toString())));
    }

    @Test
    public void testNoMatch() {
        UuidDisplayName udn = parseUuidDisplayName("ZerothAngel");
        assertNull(udn);
    }

    @Test
    public void testLongUuidMatchNoName() {
        UUID uuid = UUID.randomUUID();
        UuidDisplayName udn = parseUuidDisplayName(uuid.toString());
        assertNotNull(udn);
        assertEquals(uuid, udn.getUuid());
        assertNull(udn.getDisplayName());
    }

    @Test
    public void testShortUuidMatchNoName() {
        UUID uuid = UUID.randomUUID();
        UuidDisplayName udn = parseUuidDisplayName(longUuidToShort(uuid.toString()));
        assertNotNull(udn);
        assertEquals(uuid, udn.getUuid());
        assertNull(udn.getDisplayName());