Java application and demo code