basic example of how to control a transistor switch using Raspberry Pi in java, using pi4j library.