// Path: common/src/main/java/eu/mikroskeem/shuriken/common/Ensure.java
// public class Ensure {
//     /**
//      * Ensure that condition is true
//      *
//      * @param condition Condition
//      * @param exception Exception what will be thrown, if condition isn't true
//      * @param args Exception arguments
//      */
//     @Contract("false, _, _ -> fail")
//     public static void ensureCondition(boolean condition, Class<? extends Exception> exception, TypeWrapper... args) {
//         if(!condition) throwException(Reflect.construct(Reflect.wrapClass(exception), args).getClassInstance());
//     }
// 
//     /**
//      * Throws {@link IllegalStateException} if condition is not true
//      *
//      * @param condition Condition to assert
//      * @param text Message in {@link IllegalStateException}
//      */
//     @Contract("false, _ -> fail")
//     public static void ensureCondition(boolean condition, String text) {
//         if(!condition) throw new IllegalStateException(text);
//     }
// 
//     /**
//      * Check if reference is not null
//      *
//      * @param ref Object reference
//      * @param errorMessage NullPointerException message
//      * @param <T> Reference type
//      * @return Passed reference
//      */
//     @Contract("null, _ -> fail; !null, _ -> !null")
//     public static <T> T notNull(T ref, @Nullable String errorMessage) {
//         ensureCondition(ref != null, NullPointerException.class, of(""+errorMessage));
//         return ref;
//     }
// 
//     /**
//      * Ensure that {@link Optional} value is present
//      *
//      * @param optional Optional to check
//      * @param errorMessage NullPointerException message
//      * @param <T> Value type wrapped inside {@link Optional}
//      * @return Optional value
//      */
//     @SuppressWarnings({"ConstantConditions", "OptionalUsedAsFieldOrParameterType"})
//     @NotNull
//     @Contract("null, _ -> fail")
//     public static <T> T ensurePresent(Optional<T> optional, @Nullable String errorMessage) {
//         ensureCondition(
//                 notNull(optional, "Optional parameter shouldn't be null!").isPresent(),
//                 NullPointerException.class,
//                 of(""+errorMessage)
//         );
//         return optional.get();
//     }
// }


import eu.mikroskeem.shuriken.common.Ensure;
import org.jetbrains.annotations.NotNull;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
import static org.objectweb.asm.Opcodes.*;
package eu.mikroskeem.shuriken.instrumentation;



public final class ClassTools {
    /**
     * Unqualify class name <br>
     * In other words, <pre>foo.bar.baz</pre> -&gt; <pre>foo/bar/baz</pre>
     *
     * @param className Class name
     * @return Unqualified class name
     */
    @NotNull
    public static String unqualifyName(String className) {
// Path: common/src/main/java/eu/mikroskeem/shuriken/common/Ensure.java
// public class Ensure {
//     /**
//      * Ensure that condition is true
//      *
//      * @param condition Condition
//      * @param exception Exception what will be thrown, if condition isn't true
//      * @param args Exception arguments
//      */
//     @Contract("false, _, _ -> fail")
//     public static void ensureCondition(boolean condition, Class<? extends Exception> exception, TypeWrapper... args) {
//         if(!condition) throwException(Reflect.construct(Reflect.wrapClass(exception), args).getClassInstance());
//     }
// 
//     /**
//      * Throws {@link IllegalStateException} if condition is not true
//      *
//      * @param condition Condition to assert
//      * @param text Message in {@link IllegalStateException}
//      */
//     @Contract("false, _ -> fail")
//     public static void ensureCondition(boolean condition, String text) {
//         if(!condition) throw new IllegalStateException(text);
//     }
// 
//     /**
//      * Check if reference is not null
//      *
//      * @param ref Object reference
//      * @param errorMessage NullPointerException message
//      * @param <T> Reference type
//      * @return Passed reference
//      */
//     @Contract("null, _ -> fail; !null, _ -> !null")
//     public static <T> T notNull(T ref, @Nullable String errorMessage) {
//         ensureCondition(ref != null, NullPointerException.class, of(""+errorMessage));
//         return ref;
//     }
// 
//     /**
//      * Ensure that {@link Optional} value is present
//      *
//      * @param optional Optional to check
//      * @param errorMessage NullPointerException message
//      * @param <T> Value type wrapped inside {@link Optional}
//      * @return Optional value
//      */
//     @SuppressWarnings({"ConstantConditions", "OptionalUsedAsFieldOrParameterType"})
//     @NotNull
//     @Contract("null, _ -> fail")
//     public static <T> T ensurePresent(Optional<T> optional, @Nullable String errorMessage) {
//         ensureCondition(
//                 notNull(optional, "Optional parameter shouldn't be null!").isPresent(),
//                 NullPointerException.class,
//                 of(""+errorMessage)
//         );
//         return optional.get();
//     }
// }


// Path: instrumentation/src/main/java/eu/mikroskeem/shuriken/instrumentation/ClassTools.java
import eu.mikroskeem.shuriken.common.Ensure;
import org.jetbrains.annotations.NotNull;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
import static org.objectweb.asm.Opcodes.*;

package eu.mikroskeem.shuriken.instrumentation;



public final class ClassTools {
    /**
     * Unqualify class name <br>
     * In other words, <pre>foo.bar.baz</pre> -&gt; <pre>foo/bar/baz</pre>
     *
     * @param className Class name
     * @return Unqualified class name
     */
    @NotNull
    public static String unqualifyName(String className) {
        return Ensure.notNull(className, "Class name shouldn't be null!").replace(".", "/");