class WorkerProcessCommandLine implements CommandLine {

  @Override
  public String toString() {
    final String[] commandArray = getCommandList().toArray(new String[0]);

    final StringBuilder buffer = new StringBuilder(commandArray.length * 10);

    for (int j = 0; j < commandArray.length; ++j) {
      if (j != 0) {
        buffer.append(" ");
      }

      final boolean shouldQuote =
        j != 0 &&
        j != m_commandClassIndex &&
        !s_unquoted.contains(commandArray[j]);

      if (shouldQuote) {
        buffer.append("'");
      }

      buffer.append(commandArray[j]);

      if (shouldQuote) {
        buffer.append("'");
      }
    }

    return buffer.toString();
  }

  public  WorkerProcessCommandLine(final GrinderProperties properties,
                                  final Properties systemProperties,
                                  final String jvmArguments,
                                  final Directory workingDirectory);

}