### Question:
ArchivaNamespace extends BaseContentItem implements Namespace { public static WithAssetBuilder<WithNamespaceBuilder> withRepository( ManagedRepositoryContent repository ) { return new Builder( ).withRepository( repository ); } private  ArchivaNamespace( ); @Override String getId( ); @Override List<String> getNamespacePath( ); static WithAssetBuilder<WithNamespaceBuilder> withRepository( ManagedRepositoryContent repository ); @Override boolean equals( Object o ); @Override int hashCode( ); @Override String toString( );  }### Answer:
@Test void nullNamespaceThrowsIllegalArgumentException() { WithNamespaceBuilder builder = ArchivaNamespace.withRepository( repository ).withAsset( asset ); assertThrows( IllegalArgumentException.class, ( ) -> builder.withNamespace( null ) ); }
@Test void badSeparatorExpression() { NamespaceOptBuilder builder = ArchivaNamespace.withRepository( repository ).withAsset( asset ).withNamespace( "abc.de/abc" ); assertThrows( IllegalArgumentException.class, ( ) -> builder.withSeparatorExpression( null ) ); assertThrows( IllegalArgumentException.class, ( ) -> builder.withSeparatorExpression( "(" ) ); }
@Test void equalityTests() { ArchivaNamespace ns1 = ArchivaNamespace.withRepository( repository ).withAsset( asset ).withNamespace( "abc.de/abc" ).build(); ArchivaNamespace ns2 = ArchivaNamespace.withRepository( repository ).withAsset( asset ).withNamespace( "abc.de/abc" ).build(); ArchivaNamespace ns3 = ArchivaNamespace.withRepository( repository ).withAsset( asset ).withNamespace( "abc.de/abcd" ).build(); ArchivaNamespace ns4 = ArchivaNamespace.withRepository( repository ).withAsset( asset ).withNamespace( "abc.de/abc" ). withSeparatorExpression( "/" ).build(); ArchivaNamespace ns5 = ArchivaNamespace.withRepository( new ManagedRepositoryContentMock() ).withAsset( asset ).withNamespace( "abc.de/abc" ).build(); assertFalse( ns1 == ns2 ); assertEquals( ns1, ns2 ); assertNotEquals( ns1, ns3 ); assertEquals( ns1, ns4 ); assertNotEquals( ns1, ns5 ); }