package net.pterodactylus.sone.test import com.google.common.base.Optional import com.google.common.base.Optional.absent import com.google.common.base.Optional.of fun T?.asOptional(): Optional = if (this == null) absent() else of(this)