### Question:
ConfigurationUtil { public static Class<? extends InputFormat> getStrategy(Configuration conf, S3MapReduceCpOptions options) { String confLabel = "com.hotels.bdp.circustrain.s3mapreducecp." + options.getCopyStrategy().toLowerCase(Locale.getDefault()) + ".strategy.impl"; return conf.getClass(confLabel, UniformSizeInputFormat.class, InputFormat.class); } private  ConfigurationUtil(); static void publish(Configuration configuration, String label, T value); static int getInt(Configuration configuration, String label); static long getLong(Configuration configuration, String label); static Class<? extends InputFormat> getStrategy(Configuration conf, S3MapReduceCpOptions options);  }### Answer:
@Test public void getDefaultStrategy() { S3MapReduceCpOptions options = new S3MapReduceCpOptions(); assertThat(ConfigurationUtil.getStrategy(config, options), is(CoreMatchers.<Class<?>> equalTo(UniformSizeInputFormat.class))); }
@Test public void getCustomStrategy() { class CustomInputFormat extends InputFormat<Text, CopyListingFileStatus> { @Override public List<InputSplit> getSplits(JobContext context) throws IOException, InterruptedException { return null; } @Override public RecordReader<Text, CopyListingFileStatus> createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { return null; } } config.set("com.hotels.bdp.circustrain.s3mapreducecp.my-strategy.strategy.impl", CustomInputFormat.class.getName()); S3MapReduceCpOptions options = S3MapReduceCpOptions.builder(null, null).copyStrategy("my-strategy").build(); assertThat(ConfigurationUtil.getStrategy(config, options), is(CoreMatchers.<Class<?>> equalTo(CustomInputFormat.class))); }