abstract class A<T : Any?> : HashMap<T, T>, SortedMap<T, T> {
  constructor() /* primary */ {
    super/*HashMap*/<@FlexibleNullability T?, @FlexibleNullability T?>()
    /* <init>() */

  }

}

abstract class B<T : Any?> : HashMap<T, T>, SortedMap<T, T> {
  constructor() /* primary */ {
    super/*HashMap*/<@FlexibleNullability T?, @FlexibleNullability T?>()
    /* <init>() */

  }

  override fun put(key: T, value: T): T? {
    return CHECK_NOT_NULL<Nothing>(arg0 = null)
  }

  override fun remove(key: T): T {
    return CHECK_NOT_NULL<Nothing>(arg0 = null)
  }

}

fun test(a: A<Boolean>, b: B<Boolean?>) {
  a.<get-size>() /*~> Unit */
  a.set<Boolean, Boolean>(key = true, value = true)
  a.put(key = null, value = null) /*~> Unit */
  a.get(key = true) /*~> Unit */
  a.get(key = null) /*~> Unit */
  a.remove(key = null) /*~> Unit */
  a.remove(key = true) /*~> Unit */
  b.put(key = false, value = false) /*~> Unit */
  b.set<Boolean?, Boolean?>(key = true, value = true)
  b.remove(key = null) /*~> Unit */
}
