@Test
public void testSetNumListtatusThreads() {

  final DistCpOptions.Builder builder = new DistCpOptions.Builder(
      new Path("hdfs://localhost:8020/source/first"),
      new Path("hdfs://localhost:8020/target/"));
  // If command line argument isn't set, we expect .getNumListstatusThreads
  // option to be zero (so that we know when to override conf properties).
  Assert.assertEquals(0, builder.build().getNumListstatusThreads());
  builder.withNumListstatusThreads(12);
  Assert.assertEquals(12, builder.build().getNumListstatusThreads());
  builder.withNumListstatusThreads(0);
  Assert.assertEquals(0, builder.build().getNumListstatusThreads());
  // Ignore large number of threads.
  builder.withNumListstatusThreads(MAX_NUM_LISTSTATUS_THREADS * 2);
  Assert.assertEquals(MAX_NUM_LISTSTATUS_THREADS,
      builder.build().getNumListstatusThreads());
}