@Test
public void testSetCopyBufferSize() {

  final DistCpOptions.Builder builder = new DistCpOptions.Builder(
      Collections.singletonList(new Path("hdfs://localhost:8020/source")),
      new Path("hdfs://localhost:8020/target/"));
  Assert.assertEquals(DistCpConstants.COPY_BUFFER_SIZE_DEFAULT,
      builder.build().getCopyBufferSize());
  builder.withCopyBufferSize(4194304);
  Assert.assertEquals(4194304,
      builder.build().getCopyBufferSize());
  builder.withCopyBufferSize(-1);
  Assert.assertEquals(DistCpConstants.COPY_BUFFER_SIZE_DEFAULT,
      builder.build().getCopyBufferSize());
}