BTreeMap: replace `throw InternalError` with Java Assertions