SerializableConfiguration implements Externalizable { public static Job newJob(@Nullable SerializableConfiguration conf) throws IOException { if (conf == null) { return Job.getInstance(); } else { Job job = Job.getInstance(new Configuration(false)); for (Map.Entry<String, String> entry : conf.get()) { job.getConfiguration().set(entry.getKey(), entry.getValue()); } return job; } } SerializableConfiguration();  SerializableConfiguration(Configuration conf); Configuration get(); @Override void writeExternal(ObjectOutput out); @Override void readExternal(ObjectInput in); static Job newJob(@Nullable SerializableConfiguration conf); static Configuration newConfiguration(@Nullable SerializableConfiguration conf);  }
@Test public void testCreateNewJob() throws Exception { Job jobFromNull = SerializableConfiguration.newJob(null); assertNotNull(jobFromNull); Job job = SerializableConfiguration.newJob(DEFAULT_SERIALIZABLE_CONF); assertNotNull(job); }