Neat stuff.
To import it as a project in eclipse I used: File -> Import -> Gradle -> Gradle Project
Then browsed to the folder containing the MinecraftByExample files and the gradle-setup.
I mention this because it took me much trial and error to figure out which method of importing to use out of the 20+ methods eclipse offered up.
I believe I now have it right since the "Package Explorer" window shows a "Reference Libraries" entry that contains, among others, the realms and lwjgl libraries.
(I know a bit of java, but never used an IDE with it. My last serious use of an IDE was a Borland C++ IDE on my i386 Arima portable. )