check if inline empty map apex code example Example: check map is empty in apex if (accountRecordTypes == null || accountRecordTypes.isEmpty()) {