Since I don't have enough reputation to comment...
In the PI4J library, you use constants like "GPIO_16"...
However, these are not the GPIO pins that you find in the RPI documentation. They are the WiringPI pins.
A mapping is here: https://pinout.xyz/pinout/wiringpi
If you need more than the available 2 channels, or even more generally if you need to interface to any kind of hardware (e.g. GPS, thermometer, accelerometer, etc.), you can just use an external controller board connected to RPi through I2C. You can connect many boards to the same I2C pins by giving them unique addresses.
For example, you get 16 channels of ...
What you may need is one if these boards
They connect to the usb on the pi and then to serial on your custom board
I have used these in the past, and they work great
I found a guide here: Guide. I had to download the jdk from this site Oracle Java 8 Downloads and select the correct architecture, but following the guide after editing the java version worked perfectly.