package io.polymorphicpanda.kspec.tag

open class Tag(val name: String) {
    init {
        if (name.isEmpty()) {
            throw IllegalArgumentException("Tag name can't be empty.")
        }
    }

    final override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other?.javaClass != javaClass) return false

        other as Tag

        if (name != other.name) return false

        return true
    }

    final override fun hashCode(): Int{
        return name.hashCode()
    }

}

package io.polymorphicpanda.kspec.tag

open class Tag(val name: String) {
    init {
        if (name.isEmpty()) {
            throw IllegalArgumentException("Tag name can't be empty.")
        }
    }

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other?.javaClass != javaClass) return false

        other as Tag

        if (name != other.name) return false

        return true
    }

    override fun hashCode(): Int{
        return name.hashCode()
    }
}

Remove final on equals and hashCode methods
Remove final on equals and hashCode methods

raniejade/kspec