  @Test
  public void testArgumentsOperations() {

    String[] mainArgs = {"a", "b", "c"};
    String jarFileName = "test/123.jar";
    String libFolder = "libsdf";
    String mainClassName = "org.apache.twill.ext.Test";

    List<String> argsArrayList = ImmutableList.<String>builder()
      .add(jarFileName)
      .add(libFolder)
      .add(mainClassName)
      .addAll(Lists.newArrayList(mainArgs))
      .build();

    String[] argsArray = argsArrayList.toArray(new String[argsArrayList.size()]);

    BundledJarRunner.Arguments args = new BundledJarRunner.Arguments.Builder()
      .setMainArgs(mainArgs)
      .setJarFileName(jarFileName)
      .setLibFolder(libFolder)
      .setMainClassName(mainClassName)
      .createArguments();

    Assert.assertArrayEquals(mainArgs, args.getMainArgs());
    Assert.assertEquals(jarFileName, args.getJarFileName());
    Assert.assertEquals(libFolder, args.getLibFolder());
    Assert.assertEquals(mainClassName, args.getMainClassName());

    String[] array = args.toArray();
    Assert.assertArrayEquals(argsArray, array);
    Assert.assertEquals(args, BundledJarRunner.Arguments.fromArray(array));
  }