IntelliJ highlights Lombok generated methods as “cannot resolve method”

Check if you have added lombok dependency Maven:

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.16.18</version>
    <scope>provided</scope>
</dependency>

Gradle:

// https://mvnrepository.com/artifact/org.projectlombok/lombok
provided group: 'org.projectlombok', name: 'lombok', version: '1.16.18'

Install Lombok plugin

Preferences > Plugins > Browse Repositories >

Search for "Lombok" and install the plugin

Then you can import

import lombok.Data;

You will also need the lombok plugin.