### Question:
FhirToDhisOptionSetUtils { @Nullable public static String getIntegerOptionCode( @Nullable String code, @Nullable Pattern pattern ) { if ( (code == null) || (pattern == null) ) { return code; } final Matcher matcher = pattern.matcher( code ); if ( !matcher.matches() ) { return null; } if ( matcher.groupCount() != 1 ) { throw new TransformerScriptException( "Pattern to resolveRule integer options must have exactly one group: " + pattern.pattern() ); } return matcher.group( 1 ); } private  FhirToDhisOptionSetUtils(); @Nullable static String getIntegerOptionCode( @Nullable String code, @Nullable Pattern pattern ); @Nonnull static List<String> resolveIntegerOptionCodes( @Nonnull OptionSet optionSet, @Nullable Pattern pattern );  }### Answer:
@Test public void getIntegerOptionCodeNull() { Assert.assertNull( FhirToDhisOptionSetUtils.getIntegerOptionCode( null, Pattern.compile( "(.*)" ) ) ); }
@Test public void getIntegerOptionPattenNull() { Assert.assertEquals( "4711", FhirToDhisOptionSetUtils.getIntegerOptionCode( "4711", null ) ); }
@Test public void getIntegerOption() { Assert.assertEquals( "4711", FhirToDhisOptionSetUtils.getIntegerOptionCode( "My Test 4711 Value", Pattern.compile( "My Test (\\d+) Value" ) ) ); }
@Test( expected = TransformerScriptException.class ) public void getIntegerOptionNoGroup() { Assert.assertEquals( "4711", FhirToDhisOptionSetUtils.getIntegerOptionCode( "My Test 4711 Value", Pattern.compile( "My Test \\d+ Value" ) ) ); }