src/ThreadInputStream.java
public static void replaceSystemIn() {

        // Save the existing System.in
        InputStream console = System.in;

        // Create a ThreadInputStream and install it as System.in
        ThreadInputStream threadIn = new ThreadInputStream();
        System.setIn(threadIn);

        // Use the original System.in as the current thread's System.in
        threadIn.setThreadIn(console);
    }
/** Changes System.in to a ThreadInputStream which will
     * send input to a separate stream for each thread. */
Changes System.in to a ThreadInputStream which will
send input to a separate stream for each thread.
Changes System . in to a ThreadInputStream which will send input to a separate stream for each thread .
public static void replaceSystemIn() {
        InputStream console = System.in;
        ThreadInputStream threadIn = new ThreadInputStream();
        System.setIn(threadIn);
        threadIn.setThreadIn(console);
    }
public static void replaceSystemIn ( ) { InputStream console = System . in ; ThreadInputStream threadIn = new ThreadInputStream ( ) ; System . setIn ( threadIn ) ; threadIn . setThreadIn ( console ) ; }
Changes System.in to a ThreadInputStream which will
 send input to a separate stream for each thread.
Changes System . in to a ThreadInputStream which will send input to a separate stream for each thread .
// Save the existing System.in // Create a ThreadInputStream and install it as System.in // Use the original System.in as the current thread's System.in