### Question:
Variables implements IVariables { @Override public synchronized String environmentSubstitute( String aString ) { if ( aString == null || aString.length() == 0 ) { return aString; } return StringUtil.environmentSubstitute( aString, properties ); } Variables(); @Override void copyVariablesFrom( IVariables variables ); @Override IVariables getParentVariableSpace(); @Override void setParentVariableSpace( IVariables parent ); @Override String getVariable( String variableName, String defaultValue ); @Override String getVariable( String variableName ); @Override boolean getBooleanValueOfVariable( String variableName, boolean defaultValue ); @Override void initializeVariablesFrom( IVariables parent ); @Override String[] listVariables(); @Override synchronized void setVariable( String variableName, String variableValue ); @Override synchronized String environmentSubstitute( String aString ); @Override String fieldSubstitute( String aString, IRowMeta rowMeta, Object[] rowData ); @Override String[] environmentSubstitute( String[] string ); @Override void shareVariablesWith( IVariables variables ); @Override void injectVariables( Map<String, String> prop ); static synchronized IVariables getADefaultVariableSpace();  }### Answer:
@Test public void testEnvironmentSubstitute() { Variables vars = new Variables(); vars.setVariable( "VarOne", "DataOne" ); vars.setVariable( "VarTwo", "DataTwo" ); assertNull( vars.environmentSubstitute( (String) null ) ); assertEquals( "", vars.environmentSubstitute( "" ) ); assertEquals( "DataTwo", vars.environmentSubstitute( "${VarTwo}" ) ); assertEquals( "DataTwoEnd", vars.environmentSubstitute( "${VarTwo}End" ) ); assertEquals( 0, vars.environmentSubstitute( new String[ 0 ] ).length ); assertArrayEquals( new String[] { "DataOne", "TheDataOne" }, vars.environmentSubstitute( new String[] { "${VarOne}", "The${VarOne}" } ) ); }