Arduino, Processing and 2 HC-SR04 Ultrasonic Sensor problems. Please help....

You want us to rewrite Java to make that work? Forget it. pd1 will NEVER be NULL. Don't bother testing for an impossible situation.