anchor.diff:          environmentVariables.set("OTHER_VAR", "second value");
   
           String actual = new CommandLine(new MyApp())
  -                .getUsageMessage(CommandLine.Help.Ansi.OFF));
  +                .getUsageMessage(CommandLine.Help.Ansi.OFF);
   
           String expected = String.format("" +
                   "Usage: <main class> [--option=<option>]%n" +
  -                "      --option=<option>   Some options. Default: some-value%n");
  +                "      --option=<option>   Some option. Default: some-value%n");
           assertEquals(expected, actual);
       }
  +}
  +----
  +
  +.Kotlin/Kotest
  +[source,kotlin,role=secondary]
  +----
  +import io.kotest.core.spec.style.StringSpec
  +import io.kotest.extensions.system.withEnvironment
  +import io.kotest.matchers.shouldBe
  +import picocli.CommandLine
  +import picocli.CommandLine.Command
  +
  +class EnvironmentVarTest : StringSpec() {
  +    init {
  +        "env var" {
  +            withEnvironment(mapOf("MYVAR" to "some-value", "OTHER_VAR" to "second value")) {
  +                CommandLine(MyApp()).getUsageMessage(CommandLine.Help.Ansi.OFF) shouldBe
  +                "Usage: <main class> [--option=<option>]" + System.lineSeparator() +
  +                "      --option=<option>   Some option. Default: some-value" + System.lineSeparator()
  +            }
  +        }
  +    }
  +}
  +
  +@Command
  +class MyApp {
  +    @CommandLine.Option(names = ["--option"], defaultValue = "\${env:MYVAR}",
  +        description = ["Some option. Default: \${DEFAULT-VALUE}"])
  +    lateinit var option: String
   }
   ----
   
  
positive.code: === Testing Environment Variables
  
  Since picocli offers support for using <<Variable Interpolation,environment variables>> in the annotations, you may want to test this.
  
  ==== Java 8+ with `withEnvironmentVariable`
  Applications that use JUnit 5 or Java 8+ can use Stephan Birkner's https://github.com/stefanbirkner/system-lambda[System-Lambda] project for https://github.com/stefanbirkner/system-lambda#environment-variables[testing environment variables].
  
  Example usage:
  
  [source,java]
  ----
  import static com.github.stefanbirkner.systemlambda.SystemLambda.withEnvironmentVariable;
  // ...
  
negative.code: 
      String expected = String.format("" +
              "Usage: <main class> [--option=<option>]%n" +
              "      --option=<option>   Some option. Default: some-value%n");
      assertEquals(expected, actual);
  }
  ----
  
  .Java/JUnit 4
  [source,java,role=secondary]
  ----
  import org.junit.contrib.java.lang.system.EnvironmentVariables;
  // ...
  