@Test
public void shouldEncodeWhenNoNamespace() {

    String nameForEncoding = "test name";
    String encodedNameForEncoding = encoder.encode(nameForEncoding);
    // Make sure that we're not testing a trivial encoding
    assertThat(encodedNameForEncoding, not(nameForEncoding));
    name = new BasicName(null, nameForEncoding);
    String result = name.getString(namespaceRegistry, encoder);
    assertThat(result, is(encodedNameForEncoding));
    result = name.getString(encoder);
    assertThat(result, is(encodedNameForEncoding));
}