@Test(expected = IllegalArgumentException.class) public void illegalFlagsShouldBeDetected() { ShellMode mode = ShellMode.from("--interactive --foo"); }
public static ShellMode from(String... arguments) { if (runInBatchMode(arguments)) { return new BatchMode(extractCommand(arguments)); } return new InteractiveMode(); }
ShellMode { public static ShellMode from(String... arguments) { if (runInBatchMode(arguments)) { return new BatchMode(extractCommand(arguments)); } return new InteractiveMode(); } }
ShellMode { public static ShellMode from(String... arguments) { if (runInBatchMode(arguments)) { return new BatchMode(extractCommand(arguments)); } return new InteractiveMode(); }  }
ShellMode { public static ShellMode from(String... arguments) { if (runInBatchMode(arguments)) { return new BatchMode(extractCommand(arguments)); } return new InteractiveMode(); }  static String usage(); static ShellMode from(String... arguments); static ShellMode batch(String command); static ShellMode interactive(); abstract void start(); @Override final boolean equals(Object object); @Override abstract String toString(); }
ShellMode { public static ShellMode from(String... arguments) { if (runInBatchMode(arguments)) { return new BatchMode(extractCommand(arguments)); } return new InteractiveMode(); }  static String usage(); static ShellMode from(String... arguments); static ShellMode batch(String command); static ShellMode interactive(); abstract void start(); @Override final boolean equals(Object object); @Override abstract String toString();  }