Some of the new code in WPILib only works with the new update to the RoboRIO itself that is not released yet. Basic portions of the Java WPILib code are able to be used. You have to copy and paste these classes because if you were to try to “import” the new code, you’d get all of the new code, including some things incompatible with 2019 imaged RoboRIOs.
The code for the Swerve Drive code and many other new utilities in WPILib can be copy and pasted and “just work” on 2019 robots because that code doesn’t use certain new features that require an update to the RoboRIO.
If you think you will want to use the swerve drive code from WPILib, it’s not a bad idea to copy and paste the necessary classes into your project. If you do this, I recommend keeping the same package structure. By keeping the same package structure, when you update your code to WPILib 2020, you can delete those classes and shouldn’t have to change any of your code.
When I say keeping the same package structure, I mean that if a class is in a package called “com.example.thing”, you would copy that class to “com/example/thing” in your project. When put into your “src” folder, the layout would look like this: “src/main/java/com/example/thing/.java”
That whole package thing is optional, it would just make updating your code next year a little easier.