@Test public void shouldReturnHelloWorldWhenCallingGreet() { when(SimpleConfig.getGreeting()).thenReturn("Hello"); when(SimpleConfig.getTarget()).thenReturn("World"); HelloWorld helloWorld = new HelloWorld(); assertThat(helloWorld.greet()).isEqualTo("Hello World"); }
public String greet() { return SimpleConfig.getGreeting() + " " + SimpleConfig.getTarget(); }
HelloWorld { public String greet() { return SimpleConfig.getGreeting() + " " + SimpleConfig.getTarget(); } }
HelloWorld { public String greet() { return SimpleConfig.getGreeting() + " " + SimpleConfig.getTarget(); }  }
HelloWorld { public String greet() { return SimpleConfig.getGreeting() + " " + SimpleConfig.getTarget(); }  String greet(); }
HelloWorld { public String greet() { return SimpleConfig.getGreeting() + " " + SimpleConfig.getTarget(); }  String greet();  }