Java appl to test threads