### Question:
TelemetryApiConverter { public TelemetryRequest convertToRequest(EnvironmentTelemetry telemetry) { TelemetryRequest telemetryRequest = null; if (telemetry != null) { telemetryRequest = new TelemetryRequest(); telemetryRequest.setFluentAttributes(telemetry.getFluentAttributes()); telemetryRequest.setLogging(createLoggingRequestFromEnvSource(telemetry.getLogging())); telemetryRequest.setFeatures(createFeaturesRequestEnvSource(telemetry.getFeatures())); } return telemetryRequest; } TelemetryApiConverter(TelemetryConfiguration configuration); EnvironmentTelemetry convert(TelemetryRequest request, Features accountFeatures); TelemetryResponse convert(EnvironmentTelemetry telemetry); TelemetryRequest convertToRequest(EnvironmentTelemetry telemetry);  }### Answer:
@Test public void testConvertToRequest() { EnvironmentLogging logging = new EnvironmentLogging(); S3CloudStorageParameters s3Params = new S3CloudStorageParameters(); s3Params.setInstanceProfile(INSTANCE_PROFILE_VALUE); logging.setS3(s3Params); EnvironmentTelemetry telemetry = new EnvironmentTelemetry(); telemetry.setLogging(logging); TelemetryRequest result = underTest.convertToRequest(telemetry); assertNull(result.getFeatures()); assertEquals(INSTANCE_PROFILE_VALUE, result.getLogging().getS3().getInstanceProfile()); }
@Test public void testConvertToRequestWithFeatures() { EnvironmentLogging logging = new EnvironmentLogging(); S3CloudStorageParameters s3Params = new S3CloudStorageParameters(); s3Params.setInstanceProfile(INSTANCE_PROFILE_VALUE); logging.setS3(s3Params); EnvironmentFeatures features = new EnvironmentFeatures(); features.addClusterLogsCollection(false); features.addMonitoring(true); EnvironmentTelemetry telemetry = new EnvironmentTelemetry(); telemetry.setLogging(logging); telemetry.setFeatures(features); TelemetryRequest result = underTest.convertToRequest(telemetry); assertNotNull(result.getFeatures()); assertFalse(result.getFeatures().getClusterLogsCollection().isEnabled()); assertTrue(result.getFeatures().getMonitoring().isEnabled()); assertEquals(INSTANCE_PROFILE_VALUE, result.getLogging().getS3().getInstanceProfile()); }