NamespaceAndName { @Override public String toString() { return namespace + "/" + name; } NamespaceAndName(String namespace, String name); String getNamespace(); String getName(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void testToString() { NamespaceAndName nan = new NamespaceAndName("namespace1", "name1"); assertThat(nan.toString(), is("namespace1/name1")); }