Variable implements Serializable { @Override public String toString() { return (scope == null ? "<null>" : scope.name()) + ": " + name; } Variable(final String name);  Variable(final String name, final VariableScope scope); String getName(); VariableScope getScope(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void stringRepresentationTests() { assertThat(new Variable("name", VariableScope.GLOBAL).toString()).isEqualTo("GLOBAL: name"); assertThat(new Variable("name", VariableScope.TEST_SUITE).toString()).isEqualTo("TEST_SUITE: name"); assertThat(new Variable("name", VariableScope.TEST_CASE).toString()).isEqualTo("TEST_CASE: name"); assertThat(new Variable("name", VariableScope.LOCAL).toString()).isEqualTo("LOCAL: name"); assertThat(new Variable("name").toString()).isEqualTo("<null>: name"); }