package jp.juggler.util import java.util.LinkedHashMap // same as x?.let{ dst.add(it) } fun T.addTo(dst: ArrayList) = dst.add(this) fun > E?.notEmpty(): E? = if (this?.isNotEmpty() == true) this else null fun > E?.notEmpty(): E? = if (this?.isNotEmpty() == true) this else null fun ByteArray?.notEmpty(): ByteArray? = if (this?.isNotEmpty() == true) this else null fun Iterable>.toMutableMap() = LinkedHashMap().also { map -> forEach { map[it.first] = it.second } }