### Question:
S3MapReduceCpCopierFactory implements CopierFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return !S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired  S3MapReduceCpCopierFactory(@Value("#{sourceHiveConf}") Configuration conf, MetricRegistry runningMetricsRegistry); @Override boolean supportsSchemes(String sourceScheme, String replicaScheme); @Override Copier newInstance(CopierContext copierContext); @Override Copier newInstance(
      String eventId,
      Path sourceBaseLocation,
      Path replicaLocation,
      Map<String, Object> copierOptions); @Override Copier newInstance(
      String eventId,
      Path sourceBaseLocation,
      List<Path> sourceSubLocations,
      Path replicaLocation,
      Map<String, Object> copierOptions);  }### Answer:
@Test public void supportsSchemes() throws Exception { S3MapReduceCpCopierFactory factory = new S3MapReduceCpCopierFactory(conf, runningMetricsRegistry); assertTrue(factory.supportsSchemes("hdfs", "s3")); assertTrue(factory.supportsSchemes("hdfs", "s3a")); assertTrue(factory.supportsSchemes("hdfs", "s3n")); assertTrue(factory.supportsSchemes("file", "s3")); assertTrue(factory.supportsSchemes("whatever", "s3")); }
@Test public void doesNotsupportsSchemes() throws Exception { S3MapReduceCpCopierFactory factory = new S3MapReduceCpCopierFactory(conf, runningMetricsRegistry); assertFalse(factory.supportsSchemes("hdfs", "hdfs")); assertFalse(factory.supportsSchemes("s3", "s3")); assertFalse(factory.supportsSchemes("s3", "hdfs")); assertFalse(factory.supportsSchemes("hdfs", "s321")); }