### Question:
ResourceTypeExtensionUtils { public static void setValue( @Nonnull IBaseHasExtensions resource, @Nullable FhirResourceType fhirResourceType, @Nonnull Function<String, IElement> typeFactory ) { BaseExtensionUtils.setStringValue( URL, resource, fhirResourceType == null ? null : fhirResourceType.getResourceTypeName(), typeFactory ); } private  ResourceTypeExtensionUtils(); static void setValue( @Nonnull IBaseHasExtensions resource, @Nullable FhirResourceType fhirResourceType, @Nonnull Function<String, IElement> typeFactory ); static final String URL; }### Answer:
@Test public void resetValue() { TestPlanDefinition planDefinition = new TestPlanDefinition(); ResourceTypeExtensionUtils.setValue( planDefinition, FhirResourceType.PATIENT, TypeFactory::createType ); ResourceTypeExtensionUtils.setValue( planDefinition, null, TypeFactory::createType ); Assert.assertTrue( planDefinition.getExtension().isEmpty() ); }
@Test public void setValue() { TestPlanDefinition planDefinition = new TestPlanDefinition(); ResourceTypeExtensionUtils.setValue( planDefinition, FhirResourceType.PATIENT, TypeFactory::createType ); Assert.assertEquals( 1, planDefinition.getExtension().size() ); Assert.assertEquals( ResourceTypeExtensionUtils.URL, planDefinition.getExtension().get( 0 ).getUrl() ); Assert.assertEquals( "Patient", planDefinition.getExtension().get( 0 ).getValue().toString() ); }