In IntelliJ IDEA (or Android Studio): yes, you can. You can do it by using //region and //endregion comments or by using //<editor-fold desc="..."> and //</editor-fold>.
Example:
//region name
fun someCode() { ... }
fun someMoreCode() { ... }
//endregion
// or
//<editor-fold desc="name">
fun someCode() { ... }
fun someMoreCode() { ... }
//</editor-fold>