Java API Demo Code