public static <K, V> Write<K, V> write() {
    return new AutoValue_CdapIO_Write.Builder<K, V>().build();
  }
@Test
  public void testWriteBuildsCorrectly() {
    EmployeeConfig pluginConfig =
        new ConfigWrapper<>(EmployeeConfig.class).withParams(TEST_EMPLOYEE_PARAMS_MAP).build();

    CdapIO.Write<String, String> write =
        CdapIO.<String, String>write()
            .withCdapPlugin(
                Plugin.createBatch(
                    EmployeeBatchSink.class,
                    EmployeeOutputFormat.class,
                    EmployeeOutputFormatProvider.class))
            .withPluginConfig(pluginConfig)
            .withKeyClass(String.class)
            .withValueClass(String.class)
            .withLocksDirPath(tmpFolder.getRoot().getAbsolutePath());

    Plugin<String, String> cdapPlugin = write.getCdapPlugin();
    assertNotNull(cdapPlugin);
    assertNotNull(write.getLocksDirPath());
    assertEquals(EmployeeBatchSink.class, cdapPlugin.getPluginClass());
    assertEquals(EmployeeOutputFormat.class, cdapPlugin.getFormatClass());
    assertEquals(EmployeeOutputFormatProvider.class, cdapPlugin.getFormatProviderClass());
    assertNotNull(cdapPlugin.getContext());
    assertEquals(BatchSinkContextImpl.class, cdapPlugin.getContext().getClass());
    assertEquals(PluginConstants.PluginType.SINK, cdapPlugin.getPluginType());
    assertNotNull(cdapPlugin.getHadoopConfiguration());
    assertEquals(pluginConfig, write.getPluginConfig());
    assertEquals(String.class, write.getKeyClass());
    assertEquals(String.class, write.getValueClass());
  }