Usually - maybe more experienced - Stack Overflow users remove irrelevant/boilerplate getter/setter code from example code and add a comment like
// getters, setters
or as I do as a Lombok user by adding following annotations (well, I admit there are not so many others doing this, if any)
@Getter @Setter
By boilerplate/irrelevant I mean implementations like
public Id getId() { return this.id; }
public void setId(Id id) { this.id=id; }
so which do nothing else but just assign one field and instead of being packed can be in 4 (or even more if OP loves newlines between code lines) separate lines like
public void setId(Id id)
{
this.id=id;
}
IMO this kind of stuff does not help the reader much or might actually make the code even harder to read and so I would like to shorten OP's code by removing those and adding a comment / annotations mentioned above.
Update after Glorfindel's answer
I know that many people also copy/paste OP's code and tries to compile it as is to see what fails. I personally tend to copy only the relevant part of the code and add any getter/setter/annotation if needed mostly because the copy&paste and formatting the whole code is sometimes still a bit hard job.