public class Job implements Runnable {
  private int jobNumber;
  
  Job (int jobNumber) {
    this.jobNumber = jobNumber;
  }
  
  /**
   * Print out which job is being processed by which thread, and emulate
   * performing work.
   */
  public void run() {
    // Undertake required work. Here we will emulate it by sleeping for a period of time
    System.out.println("Job: " + jobNumber + " is being processed by thread: " + Thread.currentThread().getName());
    
    try {
      Thread.sleep(1000);
    } catch (InterruptedException e) {
      // No catching as example should not experience interruptions
    }
    System.out.println("Job: " + jobNumber + " is ending in thread: " + Thread.currentThread().getName());
  }
}
