### Question:
ElasticMapReduceProvisioner implements Provisioner { @VisibleForTesting static String getClusterName(ProgramRunInfo programRunInfo) { String cleanedAppName = programRunInfo.getApplication().replaceAll("[^A-Za-z0-9\\-]", "").toLowerCase(); int maxAppLength = 51 - CLUSTER_PREFIX.length() - 1 - programRunInfo.getRun().length(); if (cleanedAppName.length() > maxAppLength) { cleanedAppName = cleanedAppName.substring(0, maxAppLength); } return CLUSTER_PREFIX + cleanedAppName + "-" + programRunInfo.getRun(); }  @Override ProvisionerSpecification getSpec(); @Override void validateProperties(Map<String, String> properties); @Override Cluster createCluster(ProvisionerContext context); @Override ClusterStatus getClusterStatus(ProvisionerContext context, Cluster cluster); @Override Cluster getClusterDetail(ProvisionerContext context,
                                  Cluster cluster); @Override void deleteCluster(ProvisionerContext context, Cluster cluster); @Override PollingStrategy getPollingStrategy(ProvisionerContext context, Cluster cluster); @Override Capabilities getCapabilities();  }### Answer:
@Test public void testClusterName() { ProgramRunInfo programRunInfo = new ProgramRunInfo.Builder() .setNamespace("ns") .setApplication("app") .setVersion("1.0") .setProgramType("workflow") .setProgram("program") .setRun(UUID.randomUUID().toString()) .build(); Assert.assertEquals("cdap-app-" + programRunInfo.getRun(), ElasticMapReduceProvisioner.getClusterName(programRunInfo)); programRunInfo = new ProgramRunInfo.Builder() .setNamespace("ns") .setApplication("My@Appl!cation") .setVersion("1.0") .setProgramType("workflow") .setProgram("program") .setRun(UUID.randomUUID().toString()) .build(); Assert.assertEquals("cdap-myapplcat-" + programRunInfo.getRun(), ElasticMapReduceProvisioner.getClusterName(programRunInfo)); }