in progress
[jalview.git] / forester / java / src / org / forester / surfacing / TestSurfacing.java
index 44c9115..168b6a4 100644 (file)
@@ -22,7 +22,7 @@
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 //
 // Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
+// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
 
 package org.forester.surfacing;
 
@@ -53,7 +53,6 @@ import org.forester.protein.BasicProtein;
 import org.forester.protein.BinaryDomainCombination;
 import org.forester.protein.BinaryDomainCombination.DomainCombinationType;
 import org.forester.protein.Domain;
-import org.forester.protein.DomainId;
 import org.forester.protein.Protein;
 import org.forester.protein.ProteinId;
 import org.forester.species.BasicSpecies;
@@ -70,50 +69,7 @@ public class TestSurfacing {
         return ( ( Math.abs( a - b ) ) < TestSurfacing.ZERO_DIFF );
     }
 
-    private static StringBuffer mapToStringBuffer( final Map<PhylogenyNode, CharacterStateMatrix.BinaryStates> map ) {
-        final StringBuffer sb = new StringBuffer();
-        for( final PhylogenyNode key : map.keySet() ) {
-            if ( !key.isExternal() ) {
-                sb.append( key.getName() );
-                sb.append( " : " );
-                sb.append( map.get( key ).toString() );
-                sb.append( ForesterUtil.getLineSeparator() );
-            }
-        }
-        return sb;
-    }
-
     public static boolean test( final File test_dir ) {
-        System.out.print( "  Domain id: " );
-        if ( !TestSurfacing.testDomainId() ) {
-            System.out.println( "failed." );
-            return false;
-        }
-        System.out.println( "OK." );
-        System.out.print( "  Protein id: " );
-        if ( !TestSurfacing.testProteinId() ) {
-            System.out.println( "failed." );
-            return false;
-        }
-        System.out.println( "OK." );
-        System.out.print( "  Species: " );
-        if ( !TestSurfacing.testSpecies() ) {
-            System.out.println( "failed." );
-            return false;
-        }
-        System.out.println( "OK." );
-        System.out.print( "  Basic domain: " );
-        if ( !TestSurfacing.testBasicDomain() ) {
-            System.out.println( "failed." );
-            return false;
-        }
-        System.out.println( "OK." );
-        System.out.print( "  Basic protein: " );
-        if ( !TestSurfacing.testBasicProtein() ) {
-            System.out.println( "failed." );
-            return false;
-        }
-        System.out.println( "OK." );
         System.out.print( "  Combinable domains: " );
         if ( !TestSurfacing.testCombinableDomains() ) {
             System.out.println( "failed." );
@@ -191,18 +147,6 @@ public class TestSurfacing {
             return false;
         }
         System.out.println( "OK." );
-        System.out.print( "  Overlap removal: " );
-        if ( !TestSurfacing.testOverlapRemoval() ) {
-            System.out.println( "failed." );
-            return false;
-        }
-        System.out.println( "OK." );
-        System.out.print( "  Engulfing overlap removal: " );
-        if ( !TestSurfacing.testEngulfingOverlapRemoval() ) {
-            System.out.println( "failed." );
-            return false;
-        }
-        System.out.println( "OK." );
         System.out.print( "  Binary domain combination: " );
         if ( !TestSurfacing.testBinaryDomainCombination() ) {
             System.out.println( "failed." );
@@ -248,62 +192,17 @@ public class TestSurfacing {
         return true;
     }
 
-    private static boolean testBasicDomain() {
-        try {
-            final Domain pd = new BasicDomain( "id", 23, 25, ( short ) 1, ( short ) 4, 0.1, -12 );
-            if ( !pd.getDomainId().getId().equals( "id" ) ) {
-                return false;
-            }
-            if ( pd.getNumber() != 1 ) {
-                return false;
-            }
-            if ( pd.getTotalCount() != 4 ) {
-                return false;
-            }
-            if ( !pd.equals( new BasicDomain( "id", 22, 111, ( short ) 1, ( short ) 4, 0.2, -12 ) ) ) {
-                return false;
-            }
-            final Domain a1 = new BasicDomain( "a", 1, 10, ( short ) 1, ( short ) 4, 0.1, -12 );
-            final BasicDomain a1_copy = new BasicDomain( "a", 1, 10, ( short ) 1, ( short ) 4, 0.1, -12 );
-            final BasicDomain a1_equal = new BasicDomain( "a", 524, 743994, ( short ) 1, ( short ) 300, 3.0005, 230 );
-            final BasicDomain a2 = new BasicDomain( "a", 1, 10, ( short ) 2, ( short ) 4, 0.1, -12 );
-            final BasicDomain a3 = new BasicDomain( "A", 1, 10, ( short ) 1, ( short ) 4, 0.1, -12 );
-            if ( !a1.equals( a1 ) ) {
-                return false;
-            }
-            if ( !a1.equals( a1_copy ) ) {
-                return false;
-            }
-            if ( !a1.equals( a1_equal ) ) {
-                return false;
-            }
-            if ( !a1.equals( a2 ) ) {
-                return false;
-            }
-            if ( a1.equals( a3 ) ) {
-                return false;
-            }
-            if ( a1.compareTo( a1 ) != 0 ) {
-                return false;
-            }
-            if ( a1.compareTo( a1_copy ) != 0 ) {
-                return false;
-            }
-            if ( a1.compareTo( a1_equal ) != 0 ) {
-                return false;
-            }
-            if ( a1.compareTo( a2 ) != 0 ) {
-                return false;
-            }
-            if ( a1.compareTo( a3 ) != 0 ) {
-                return false;
+    private static StringBuffer mapToStringBuffer( final Map<PhylogenyNode, CharacterStateMatrix.BinaryStates> map ) {
+        final StringBuffer sb = new StringBuffer();
+        for( final PhylogenyNode key : map.keySet() ) {
+            if ( !key.isExternal() ) {
+                sb.append( key.getName() );
+                sb.append( " : " );
+                sb.append( map.get( key ).toString() );
+                sb.append( ForesterUtil.getLineSeparator() );
             }
         }
-        catch ( final Exception e ) {
-            e.printStackTrace( System.out );
-            return false;
-        }
-        return true;
+        return sb;
     }
 
     private static boolean testBasicDomainSimilarityCalculator() {
@@ -416,7 +315,8 @@ public class TestSurfacing {
                                                                            new BasicSpecies( "nemve" ) ) );
             final DomainSimilarityCalculator calc = new BasicDomainSimilarityCalculator( DomainSimilarity.DomainSimilaritySortField.DOMAIN_ID,
                                                                                          false,
-                                                                                         false );
+                                                                                         false,
+                                                                                         true );
             final SortedSet<DomainSimilarity> sims = calc
                     .calculateSimilarities( new CombinationsBasedPairwiseDomainSimilarityCalculator(),
                                             cdc_list,
@@ -424,7 +324,7 @@ public class TestSurfacing {
                                             true );
             final Iterator<DomainSimilarity> sims_it = sims.iterator();
             final DomainSimilarity sa = sims_it.next();
-            if ( !sa.getDomainId().getId().equals( "A" ) ) {
+            if ( !sa.getDomainId().equals( "A" ) ) {
                 return false;
             }
             if ( sa.getSpeciesData().size() != 4 ) {
@@ -442,8 +342,8 @@ public class TestSurfacing {
             if ( !sa.getSpecies().contains( new BasicSpecies( "rabbit" ) ) ) {
                 return false;
             }
-            if ( !TestSurfacing.isEqual( sa.getMeanSimilarityScore(),
-                                         ( 2.0 / 5 + 0 + 2.0 / 3 + 1.0 / 5 + 1.0 / 2 + 2.0 / 7 ) / 6 ) ) {
+            if ( !TestSurfacing.isEqual( sa.getMeanSimilarityScore(), ( ( 2.0 / 5 ) + 0 + ( 2.0 / 3 ) + ( 1.0 / 5 )
+                    + ( 1.0 / 2 ) + ( 2.0 / 7 ) ) / 6 ) ) {
                 return false;
             }
             if ( !TestSurfacing.isEqual( sa.getStandardDeviationOfSimilarityScore(), ( 0.23410788192183737 ) ) ) {
@@ -465,7 +365,7 @@ public class TestSurfacing {
                 return false;
             }
             final DomainSimilarity sb = sims_it.next();
-            if ( !sb.getDomainId().getId().equals( "B" ) ) {
+            if ( !sb.getDomainId().equals( "B" ) ) {
                 return false;
             }
             if ( sb.getSpeciesData().size() != 2 ) {
@@ -499,7 +399,7 @@ public class TestSurfacing {
                 return false;
             }
             final DomainSimilarity sc = sims_it.next();
-            if ( !sc.getDomainId().getId().equals( "C" ) ) {
+            if ( !sc.getDomainId().equals( "C" ) ) {
                 return false;
             }
             if ( sc.getSpeciesData().size() != 3 ) {
@@ -514,7 +414,7 @@ public class TestSurfacing {
             if ( !sc.getSpecies().contains( new BasicSpecies( "nemve" ) ) ) {
                 return false;
             }
-            if ( !TestSurfacing.isEqual( sc.getMeanSimilarityScore(), ( 2.0 / 5 + 2.0 / 3 + 1.0 / 2 ) / 3 ) ) {
+            if ( !TestSurfacing.isEqual( sc.getMeanSimilarityScore(), ( ( 2.0 / 5 ) + ( 2.0 / 3 ) + ( 1.0 / 2 ) ) / 3 ) ) {
                 return false;
             }
             if ( !TestSurfacing.isEqual( sc.getStandardDeviationOfSimilarityScore(), 0.13471506281091264 ) ) {
@@ -566,7 +466,8 @@ public class TestSurfacing {
                                                                             new BasicSpecies( "nemve" ) ) );
             final DomainSimilarityCalculator calc2 = new BasicDomainSimilarityCalculator( DomainSimilarity.DomainSimilaritySortField.DOMAIN_ID,
                                                                                           false,
-                                                                                          false );
+                                                                                          false,
+                                                                                          true );
             final SortedSet<DomainSimilarity> sims2 = calc2
                     .calculateSimilarities( new CombinationsBasedPairwiseDomainSimilarityCalculator(),
                                             cdc_list2,
@@ -574,7 +475,7 @@ public class TestSurfacing {
                                             true );
             final Iterator<DomainSimilarity> sims_it2 = sims2.iterator();
             final DomainSimilarity sa2 = sims_it2.next();
-            if ( !sa2.getDomainId().getId().equals( "A" ) ) {
+            if ( !sa2.getDomainId().equals( "A" ) ) {
                 return false;
             }
             if ( sa2.getSpeciesData().size() != 4 ) {
@@ -592,8 +493,8 @@ public class TestSurfacing {
             if ( !sa2.getSpeciesData().keySet().contains( new BasicSpecies( "rabbit" ) ) ) {
                 return false;
             }
-            if ( !TestSurfacing.isEqual( sa2.getMeanSimilarityScore(),
-                                         ( 2.0 / 5 + 0 + 2.0 / 3 + 1.0 / 6 + 1.0 / 2 + 2.0 / 8 ) / 6 ) ) {
+            if ( !TestSurfacing.isEqual( sa2.getMeanSimilarityScore(), ( ( 2.0 / 5 ) + 0 + ( 2.0 / 3 ) + ( 1.0 / 6 )
+                    + ( 1.0 / 2 ) + ( 2.0 / 8 ) ) / 6 ) ) {
                 return false;
             }
             if ( !TestSurfacing.isEqual( sa2.getStandardDeviationOfSimilarityScore(), ( 0.2404663678647683 ) ) ) {
@@ -653,7 +554,8 @@ public class TestSurfacing {
                                                                             new BasicSpecies( "nemve" ) ) );
             final DomainSimilarityCalculator calc3 = new BasicDomainSimilarityCalculator( DomainSimilarity.DomainSimilaritySortField.DOMAIN_ID,
                                                                                           false,
-                                                                                          false );
+                                                                                          false,
+                                                                                          true );
             final SortedSet<DomainSimilarity> sims3 = calc3
                     .calculateSimilarities( new CombinationsBasedPairwiseDomainSimilarityCalculator(),
                                             cdc_list3,
@@ -661,23 +563,23 @@ public class TestSurfacing {
                                             true );
             final Iterator<DomainSimilarity> sims_it3 = sims3.iterator();
             final DomainSimilarity sa3 = sims_it3.next();
-            if ( !sa3.getDomainId().getId().equals( "A" ) ) {
+            if ( !sa3.getDomainId().equals( "A" ) ) {
                 return false;
             }
-            final SpeciesSpecificDomainSimilariyData ssdsd = sa3.getSpeciesData().get( new BasicSpecies( "ciona" ) );
+            final SpeciesSpecificDcData ssdsd = sa3.getSpeciesData().get( new BasicSpecies( "ciona" ) );
             if ( ssdsd.getCombinableDomainIdToCountsMap().size() != 4 ) {
                 return false;
             }
-            if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "B" ) ) != 2 ) {
+            if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( "B" ) != 2 ) {
                 return false;
             }
-            if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "F" ) ) != 2 ) {
+            if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( "F" ) != 2 ) {
                 return false;
             }
-            if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "G" ) ) != 2 ) {
+            if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( "G" ) != 2 ) {
                 return false;
             }
-            if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "X" ) ) != 3 ) {
+            if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( "X" ) != 3 ) {
                 return false;
             }
             final List<GenomeWideCombinableDomains> cdc_list4 = new ArrayList<GenomeWideCombinableDomains>();
@@ -696,7 +598,8 @@ public class TestSurfacing {
                                                                             new BasicSpecies( "nemve" ) ) );
             final DomainSimilarityCalculator calc4 = new BasicDomainSimilarityCalculator( DomainSimilarity.DomainSimilaritySortField.DOMAIN_ID,
                                                                                           true,
-                                                                                          false );
+                                                                                          false,
+                                                                                          true );
             final SortedSet<DomainSimilarity> sims4 = calc4
                     .calculateSimilarities( new CombinationsBasedPairwiseDomainSimilarityCalculator(),
                                             cdc_list4,
@@ -704,46 +607,47 @@ public class TestSurfacing {
                                             true );
             final Iterator<DomainSimilarity> sims_it4 = sims4.iterator();
             final DomainSimilarity sa4 = sims_it4.next();
-            if ( !sa4.getDomainId().getId().equals( "A" ) ) {
+            if ( !sa4.getDomainId().equals( "A" ) ) {
                 return false;
             }
-            final SpeciesSpecificDomainSimilariyData ssdsd4 = sa4.getSpeciesData().get( new BasicSpecies( "ciona" ) );
+            final SpeciesSpecificDcData ssdsd4 = sa4.getSpeciesData().get( new BasicSpecies( "ciona" ) );
             if ( ssdsd4.getCombinableDomainIdToCountsMap().size() != 5 ) {
                 return false;
             }
-            if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "A" ) ) != 3 ) {
+            if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( "A" ) != 3 ) {
                 return false;
             }
-            if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "B" ) ) != 2 ) {
+            if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( "B" ) != 2 ) {
                 return false;
             }
-            if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "F" ) ) != 2 ) {
+            if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( "F" ) != 2 ) {
                 return false;
             }
-            if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "G" ) ) != 2 ) {
+            if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( "G" ) != 2 ) {
                 return false;
             }
-            if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "X" ) ) != 3 ) {
+            if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( "X" ) != 3 ) {
                 return false;
             }
             final SortedSet<DomainSimilarity> sims4_d = calc4
                     .calculateSimilarities( new DomainCountsBasedPairwiseSimilarityCalculator(), cdc_list4, false, true );
             final Iterator<DomainSimilarity> sims_it4_d = sims4_d.iterator();
             final DomainSimilarity sa4_d = sims_it4_d.next();
-            if ( !sa4_d.getDomainId().getId().equals( "A" ) ) {
+            if ( !sa4_d.getDomainId().equals( "A" ) ) {
                 return false;
             }
             if ( sa4_d.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).size() != 5 ) {
                 return false;
             }
-            if ( !TestSurfacing.isEqual( sa4_d.getMeanSimilarityScore(), ( 1 + 1 - 11.0 / 13 + 1 - 11.0 / 13 + 1 + 1
-                    + 1 - 11.0 / 13 ) / 6.0 ) ) {
+            if ( !TestSurfacing
+                    .isEqual( sa4_d.getMeanSimilarityScore(),
+                              ( ( ( ( ( ( 1 + 1 ) - ( 11.0 / 13 ) ) + 1 ) - ( 11.0 / 13 ) ) + 1 + 1 + 1 ) - ( 11.0 / 13 ) ) / 6.0 ) ) {
                 return false;
             }
             if ( !TestSurfacing.isEqual( sa4_d.getMaximalSimilarityScore(), 1.0 ) ) {
                 return false;
             }
-            if ( !TestSurfacing.isEqual( sa4_d.getMinimalSimilarityScore(), ( 1 - 11.0 / 13 ) ) ) {
+            if ( !TestSurfacing.isEqual( sa4_d.getMinimalSimilarityScore(), ( 1 - ( 11.0 / 13 ) ) ) ) {
                 return false;
             }
             if ( sa4_d.getN() != 6 ) {
@@ -756,35 +660,36 @@ public class TestSurfacing {
                                             true );
             final Iterator<DomainSimilarity> sims_it4_p = sims4_p.iterator();
             final DomainSimilarity sa4_p = sims_it4_p.next();
-            if ( !sa4_p.getDomainId().getId().equals( "A" ) ) {
+            if ( !sa4_p.getDomainId().equals( "A" ) ) {
                 return false;
             }
             if ( sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).size() != 5 ) {
                 return false;
             }
-            if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( new DomainId( "A" ) ) ) {
+            if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( "A" ) ) {
                 return false;
             }
-            if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( new DomainId( "B" ) ) ) {
+            if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( "B" ) ) {
                 return false;
             }
-            if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( new DomainId( "F" ) ) ) {
+            if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( "F" ) ) {
                 return false;
             }
-            if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( new DomainId( "G" ) ) ) {
+            if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( "G" ) ) {
                 return false;
             }
-            if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( new DomainId( "X" ) ) ) {
+            if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( "X" ) ) {
                 return false;
             }
-            if ( !TestSurfacing.isEqual( sa4_p.getMeanSimilarityScore(),
-                                         ( 1 + 1 - 2.0 / 4 + 1 - 2.0 / 4 + 1 + 1 + 1 - 2.0 / 4 ) / 6.0 ) ) {
+            if ( !TestSurfacing
+                    .isEqual( sa4_p.getMeanSimilarityScore(),
+                              ( ( ( ( ( ( 1 + 1 ) - ( 2.0 / 4 ) ) + 1 ) - ( 2.0 / 4 ) ) + 1 + 1 + 1 ) - ( 2.0 / 4 ) ) / 6.0 ) ) {
                 return false;
             }
             if ( !TestSurfacing.isEqual( sa4_p.getMaximalSimilarityScore(), 1 ) ) {
                 return false;
             }
-            if ( !TestSurfacing.isEqual( sa4_p.getMinimalSimilarityScore(), ( 1 - 2.0 / 4 ) ) ) {
+            if ( !TestSurfacing.isEqual( sa4_p.getMinimalSimilarityScore(), ( 1 - ( 2.0 / 4 ) ) ) ) {
                 return false;
             }
             if ( sa4_p.getN() != 6 ) {
@@ -813,52 +718,53 @@ public class TestSurfacing {
             if ( !sa5_d.getSpecies().last().equals( new BasicSpecies( "rabbit" ) ) ) {
                 return false;
             }
-            final SpeciesSpecificDomainSimilariyData ssdsd5 = sa5_d.getSpeciesData().get( new BasicSpecies( "ciona" ) );
+            final SpeciesSpecificDcData ssdsd5 = sa5_d.getSpeciesData().get( new BasicSpecies( "ciona" ) );
             if ( ssdsd5.getCombinableDomainIdToCountsMap().size() != 4 ) {
                 return false;
             }
-            if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "B" ) ) != 2 ) {
+            if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( "B" ) != 2 ) {
                 return false;
             }
-            if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "F" ) ) != 2 ) {
+            if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( "F" ) != 2 ) {
                 return false;
             }
-            if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "G" ) ) != 2 ) {
+            if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( "G" ) != 2 ) {
                 return false;
             }
-            if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "X" ) ) != 3 ) {
+            if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( "X" ) != 3 ) {
                 return false;
             }
-            if ( !sa5_d.getDomainId().getId().equals( "A" ) ) {
+            if ( !sa5_d.getDomainId().equals( "A" ) ) {
                 return false;
             }
             final Species ciona = new BasicSpecies( "ciona" );
             if ( sa5_d.getCombinableDomainIds( ciona ).size() != 4 ) {
                 return false;
             }
-            if ( sa5_d.getCombinableDomainIds( ciona ).contains( new DomainId( "A" ) ) ) {
+            if ( sa5_d.getCombinableDomainIds( ciona ).contains( "A" ) ) {
                 return false;
             }
-            if ( !sa5_d.getCombinableDomainIds( ciona ).contains( new DomainId( "B" ) ) ) {
+            if ( !sa5_d.getCombinableDomainIds( ciona ).contains( "B" ) ) {
                 return false;
             }
-            if ( !sa5_d.getCombinableDomainIds( ciona ).contains( new DomainId( "F" ) ) ) {
+            if ( !sa5_d.getCombinableDomainIds( ciona ).contains( "F" ) ) {
                 return false;
             }
-            if ( !sa5_d.getCombinableDomainIds( ciona ).contains( new DomainId( "G" ) ) ) {
+            if ( !sa5_d.getCombinableDomainIds( ciona ).contains( "G" ) ) {
                 return false;
             }
-            if ( !sa5_d.getCombinableDomainIds( ciona ).contains( new DomainId( "X" ) ) ) {
+            if ( !sa5_d.getCombinableDomainIds( ciona ).contains( "X" ) ) {
                 return false;
             }
-            if ( !TestSurfacing.isEqual( sa5_d.getMeanSimilarityScore(), ( 1 + 1 - 11.0 / 13 + 1 - 11.0 / 13 + 1 + 1
-                    + 1 - 11.0 / 13 ) / 6.0 ) ) {
+            if ( !TestSurfacing
+                    .isEqual( sa5_d.getMeanSimilarityScore(),
+                              ( ( ( ( ( ( 1 + 1 ) - ( 11.0 / 13 ) ) + 1 ) - ( 11.0 / 13 ) ) + 1 + 1 + 1 ) - ( 11.0 / 13 ) ) / 6.0 ) ) {
                 return false;
             }
             if ( !TestSurfacing.isEqual( sa5_d.getMaximalSimilarityScore(), 1.0 ) ) {
                 return false;
             }
-            if ( !TestSurfacing.isEqual( sa5_d.getMinimalSimilarityScore(), ( 1 - 11.0 / 13 ) ) ) {
+            if ( !TestSurfacing.isEqual( sa5_d.getMinimalSimilarityScore(), ( 1 - ( 11.0 / 13 ) ) ) ) {
                 return false;
             }
             if ( sa5_d.getN() != 6 ) {
@@ -880,35 +786,36 @@ public class TestSurfacing {
                                             true );
             final Iterator<DomainSimilarity> sims_it5_p = sims5_p.iterator();
             final DomainSimilarity sa5_p = sims_it5_p.next();
-            if ( !sa5_p.getDomainId().getId().equals( "A" ) ) {
+            if ( !sa5_p.getDomainId().equals( "A" ) ) {
                 return false;
             }
             if ( sa5_p.getCombinableDomainIds( ciona ).size() != 4 ) {
                 return false;
             }
-            if ( sa5_p.getCombinableDomainIds( ciona ).contains( new DomainId( "A" ) ) ) {
+            if ( sa5_p.getCombinableDomainIds( ciona ).contains( "A" ) ) {
                 return false;
             }
-            if ( !sa5_p.getCombinableDomainIds( ciona ).contains( new DomainId( "B" ) ) ) {
+            if ( !sa5_p.getCombinableDomainIds( ciona ).contains( "B" ) ) {
                 return false;
             }
-            if ( !sa5_p.getCombinableDomainIds( ciona ).contains( new DomainId( "F" ) ) ) {
+            if ( !sa5_p.getCombinableDomainIds( ciona ).contains( "F" ) ) {
                 return false;
             }
-            if ( !sa5_p.getCombinableDomainIds( ciona ).contains( new DomainId( "G" ) ) ) {
+            if ( !sa5_p.getCombinableDomainIds( ciona ).contains( "G" ) ) {
                 return false;
             }
-            if ( !sa5_p.getCombinableDomainIds( ciona ).contains( new DomainId( "X" ) ) ) {
+            if ( !sa5_p.getCombinableDomainIds( ciona ).contains( "X" ) ) {
                 return false;
             }
-            if ( !TestSurfacing.isEqual( sa5_p.getMeanSimilarityScore(),
-                                         ( 1 + 1 - 2.0 / 4 + 1 - 2.0 / 4 + 1 + 1 + 1 - 2.0 / 4 ) / 6.0 ) ) {
+            if ( !TestSurfacing
+                    .isEqual( sa5_p.getMeanSimilarityScore(),
+                              ( ( ( ( ( ( 1 + 1 ) - ( 2.0 / 4 ) ) + 1 ) - ( 2.0 / 4 ) ) + 1 + 1 + 1 ) - ( 2.0 / 4 ) ) / 6.0 ) ) {
                 return false;
             }
             if ( !TestSurfacing.isEqual( sa5_p.getMaximalSimilarityScore(), 1 ) ) {
                 return false;
             }
-            if ( !TestSurfacing.isEqual( sa5_p.getMinimalSimilarityScore(), ( 1 - 2.0 / 4 ) ) ) {
+            if ( !TestSurfacing.isEqual( sa5_p.getMinimalSimilarityScore(), ( 1 - ( 2.0 / 4 ) ) ) ) {
                 return false;
             }
             if ( sa5_p.getN() != 6 ) {
@@ -946,52 +853,53 @@ public class TestSurfacing {
             if ( !sa6_d.getSpecies().last().equals( new BasicSpecies( "rabbit" ) ) ) {
                 return false;
             }
-            final SpeciesSpecificDomainSimilariyData ssdsd6 = sa6_d.getSpeciesData().get( new BasicSpecies( "ciona" ) );
+            final SpeciesSpecificDcData ssdsd6 = sa6_d.getSpeciesData().get( new BasicSpecies( "ciona" ) );
             if ( ssdsd6.getCombinableDomainIdToCountsMap().size() != 5 ) {
                 return false;
             }
-            if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "B" ) ) != 2 ) {
+            if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( "B" ) != 2 ) {
                 return false;
             }
-            if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "F" ) ) != 2 ) {
+            if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( "F" ) != 2 ) {
                 return false;
             }
-            if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "G" ) ) != 2 ) {
+            if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( "G" ) != 2 ) {
                 return false;
             }
-            if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "X" ) ) != 3 ) {
+            if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( "X" ) != 3 ) {
                 return false;
             }
-            if ( !sa5_d.getDomainId().getId().equals( "A" ) ) {
+            if ( !sa5_d.getDomainId().equals( "A" ) ) {
                 return false;
             }
             final Species ciona6 = new BasicSpecies( "ciona" );
             if ( sa6_d.getCombinableDomainIds( ciona6 ).size() != 5 ) {
                 return false;
             }
-            if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( new DomainId( "A" ) ) ) {
+            if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( "A" ) ) {
                 return false;
             }
-            if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( new DomainId( "B" ) ) ) {
+            if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( "B" ) ) {
                 return false;
             }
-            if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( new DomainId( "F" ) ) ) {
+            if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( "F" ) ) {
                 return false;
             }
-            if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( new DomainId( "G" ) ) ) {
+            if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( "G" ) ) {
                 return false;
             }
-            if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( new DomainId( "X" ) ) ) {
+            if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( "X" ) ) {
                 return false;
             }
-            if ( !TestSurfacing.isEqual( sa6_d.getMeanSimilarityScore(), ( 1 + 1 - 11.0 / 13 + 1 - 11.0 / 13 + 1 + 1
-                    + 1 - 11.0 / 13 ) / 6.0 ) ) {
+            if ( !TestSurfacing
+                    .isEqual( sa6_d.getMeanSimilarityScore(),
+                              ( ( ( ( ( ( 1 + 1 ) - ( 11.0 / 13 ) ) + 1 ) - ( 11.0 / 13 ) ) + 1 + 1 + 1 ) - ( 11.0 / 13 ) ) / 6.0 ) ) {
                 return false;
             }
             if ( !TestSurfacing.isEqual( sa6_d.getMaximalSimilarityScore(), 1.0 ) ) {
                 return false;
             }
-            if ( !TestSurfacing.isEqual( sa6_d.getMinimalSimilarityScore(), ( 1 - 11.0 / 13 ) ) ) {
+            if ( !TestSurfacing.isEqual( sa6_d.getMinimalSimilarityScore(), ( 1 - ( 11.0 / 13 ) ) ) ) {
                 return false;
             }
             if ( sa6_d.getN() != 6 ) {
@@ -1013,35 +921,36 @@ public class TestSurfacing {
                                             true );
             final Iterator<DomainSimilarity> sims_it6_p = sims6_p.iterator();
             final DomainSimilarity sa6_p = sims_it6_p.next();
-            if ( !sa6_p.getDomainId().getId().equals( "A" ) ) {
+            if ( !sa6_p.getDomainId().equals( "A" ) ) {
                 return false;
             }
             if ( sa6_p.getCombinableDomainIds( ciona ).size() != 5 ) {
                 return false;
             }
-            if ( !sa6_p.getCombinableDomainIds( ciona ).contains( new DomainId( "A" ) ) ) {
+            if ( !sa6_p.getCombinableDomainIds( ciona ).contains( "A" ) ) {
                 return false;
             }
-            if ( !sa6_p.getCombinableDomainIds( ciona ).contains( new DomainId( "B" ) ) ) {
+            if ( !sa6_p.getCombinableDomainIds( ciona ).contains( "B" ) ) {
                 return false;
             }
-            if ( !sa6_p.getCombinableDomainIds( ciona ).contains( new DomainId( "F" ) ) ) {
+            if ( !sa6_p.getCombinableDomainIds( ciona ).contains( "F" ) ) {
                 return false;
             }
-            if ( !sa6_p.getCombinableDomainIds( ciona ).contains( new DomainId( "G" ) ) ) {
+            if ( !sa6_p.getCombinableDomainIds( ciona ).contains( "G" ) ) {
                 return false;
             }
-            if ( !sa6_p.getCombinableDomainIds( ciona ).contains( new DomainId( "X" ) ) ) {
+            if ( !sa6_p.getCombinableDomainIds( ciona ).contains( "X" ) ) {
                 return false;
             }
-            if ( !TestSurfacing.isEqual( sa6_p.getMeanSimilarityScore(),
-                                         ( 1 + 1 - 2.0 / 4 + 1 - 2.0 / 4 + 1 + 1 + 1 - 2.0 / 4 ) / 6.0 ) ) {
+            if ( !TestSurfacing
+                    .isEqual( sa6_p.getMeanSimilarityScore(),
+                              ( ( ( ( ( ( 1 + 1 ) - ( 2.0 / 4 ) ) + 1 ) - ( 2.0 / 4 ) ) + 1 + 1 + 1 ) - ( 2.0 / 4 ) ) / 6.0 ) ) {
                 return false;
             }
             if ( !TestSurfacing.isEqual( sa6_p.getMaximalSimilarityScore(), 1 ) ) {
                 return false;
             }
-            if ( !TestSurfacing.isEqual( sa6_p.getMinimalSimilarityScore(), ( 1 - 2.0 / 4 ) ) ) {
+            if ( !TestSurfacing.isEqual( sa6_p.getMinimalSimilarityScore(), ( 1 - ( 2.0 / 4 ) ) ) ) {
                 return false;
             }
             if ( sa6_p.getN() != 6 ) {
@@ -1121,7 +1030,8 @@ public class TestSurfacing {
                                                                            new BasicSpecies( "nemve" ) ) );
             final DomainSimilarityCalculator calc = new BasicDomainSimilarityCalculator( DomainSimilarity.DomainSimilaritySortField.DOMAIN_ID,
                                                                                          false,
-                                                                                         false );
+                                                                                         false,
+                                                                                         true );
             final SortedSet<DomainSimilarity> sims = calc
                     .calculateSimilarities( new CombinationsBasedPairwiseDomainSimilarityCalculator(),
                                             cdc_list,
@@ -1129,7 +1039,7 @@ public class TestSurfacing {
                                             false );
             final Iterator<DomainSimilarity> sims_it = sims.iterator();
             final DomainSimilarity sa = sims_it.next();
-            if ( !sa.getDomainId().getId().equals( "A" ) ) {
+            if ( !sa.getDomainId().equals( "A" ) ) {
                 return false;
             }
             if ( sa.getSpeciesData().size() != 1 ) {
@@ -1160,7 +1070,7 @@ public class TestSurfacing {
                 return false;
             }
             final DomainSimilarity sb = sims_it.next();
-            if ( !sb.getDomainId().getId().equals( "B" ) ) {
+            if ( !sb.getDomainId().equals( "B" ) ) {
                 return false;
             }
             if ( sb.getSpeciesData().size() != 1 ) {
@@ -1176,7 +1086,7 @@ public class TestSurfacing {
                                             true );
             final Iterator<DomainSimilarity> sims_it2 = sims2.iterator();
             final DomainSimilarity sa2 = sims_it2.next();
-            if ( !sa2.getDomainId().getId().equals( "D" ) ) {
+            if ( !sa2.getDomainId().equals( "D" ) ) {
                 return false;
             }
             if ( sa2.getSpeciesData().size() != 2 ) {
@@ -1229,7 +1139,8 @@ public class TestSurfacing {
                                                                            new BasicSpecies( "nemve" ) ) );
             final DomainSimilarityCalculator calc = new BasicDomainSimilarityCalculator( DomainSimilarity.DomainSimilaritySortField.DOMAIN_ID,
                                                                                          false,
-                                                                                         false );
+                                                                                         false,
+                                                                                         true );
             final SortedSet<DomainSimilarity> sims = calc
                     .calculateSimilarities( new CombinationsBasedPairwiseDomainSimilarityCalculator(),
                                             cdc_list,
@@ -1240,7 +1151,7 @@ public class TestSurfacing {
             }
             final Iterator<DomainSimilarity> sims_it = sims.iterator();
             final DomainSimilarity sa = sims_it.next();
-            if ( !sa.getDomainId().getId().equals( "A" ) ) {
+            if ( !sa.getDomainId().equals( "A" ) ) {
                 return false;
             }
             if ( sa.getSpeciesData().size() != 4 ) {
@@ -1316,280 +1227,6 @@ public class TestSurfacing {
         return true;
     }
 
-    private static boolean testBasicProtein() {
-        try {
-            // A0  A10  B15  A20  B25  A30  B35  B40  C50  A60  C70  D80
-            final Domain A0 = new BasicDomain( "A", 0, 25, ( short ) 1, ( short ) 4, 0.1, -12 );
-            final Domain A10 = new BasicDomain( "A", 10, 11, ( short ) 1, ( short ) 4, 0.1, -12 );
-            final Domain B15 = new BasicDomain( "B", 11, 16, ( short ) 1, ( short ) 4, 0.1, -12 );
-            final Domain A20 = new BasicDomain( "A", 20, 100, ( short ) 1, ( short ) 4, 0.1, -12 );
-            final Domain B25 = new BasicDomain( "B", 25, 26, ( short ) 1, ( short ) 4, 0.1, -12 );
-            final Domain A30 = new BasicDomain( "A", 30, 31, ( short ) 1, ( short ) 4, 0.1, -12 );
-            final Domain B35 = new BasicDomain( "B", 31, 40, ( short ) 1, ( short ) 4, 0.1, -12 );
-            final Domain B40 = new BasicDomain( "B", 40, 600, ( short ) 1, ( short ) 4, 0.1, -12 );
-            final Domain C50 = new BasicDomain( "C", 50, 59, ( short ) 1, ( short ) 4, 0.1, -12 );
-            final Domain A60 = new BasicDomain( "A", 60, 395, ( short ) 1, ( short ) 4, 0.1, -12 );
-            final Domain C70 = new BasicDomain( "C", 70, 71, ( short ) 1, ( short ) 4, 0.1, -12 );
-            final Domain D80 = new BasicDomain( "D", 80, 81, ( short ) 1, ( short ) 4, 0.1, -12 );
-            final BasicProtein p = new BasicProtein( "p", "owl", 0 );
-            p.addProteinDomain( B15 );
-            p.addProteinDomain( C50 );
-            p.addProteinDomain( A60 );
-            p.addProteinDomain( A30 );
-            p.addProteinDomain( C70 );
-            p.addProteinDomain( B35 );
-            p.addProteinDomain( B40 );
-            p.addProteinDomain( A0 );
-            p.addProteinDomain( A10 );
-            p.addProteinDomain( A20 );
-            p.addProteinDomain( B25 );
-            p.addProteinDomain( D80 );
-            List<DomainId> domains_ids = new ArrayList<DomainId>();
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            if ( !p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( !p.contains( domains_ids, true ) ) {
-                return false;
-            }
-            domains_ids.add( new DomainId( "X" ) );
-            if ( p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( p.contains( domains_ids, true ) ) {
-                return false;
-            }
-            domains_ids = new ArrayList<DomainId>();
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            domains_ids.add( new DomainId( "D" ) );
-            if ( !p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( !p.contains( domains_ids, true ) ) {
-                return false;
-            }
-            domains_ids = new ArrayList<DomainId>();
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "D" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            if ( !p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( p.contains( domains_ids, true ) ) {
-                return false;
-            }
-            domains_ids = new ArrayList<DomainId>();
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            if ( !p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( !p.contains( domains_ids, true ) ) {
-                return false;
-            }
-            domains_ids = new ArrayList<DomainId>();
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            if ( !p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( !p.contains( domains_ids, true ) ) {
-                return false;
-            }
-            domains_ids = new ArrayList<DomainId>();
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            if ( !p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( !p.contains( domains_ids, true ) ) {
-                return false;
-            }
-            domains_ids = new ArrayList<DomainId>();
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            if ( !p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( p.contains( domains_ids, true ) ) {
-                return false;
-            }
-            domains_ids = new ArrayList<DomainId>();
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            domains_ids.add( new DomainId( "D" ) );
-            if ( !p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( !p.contains( domains_ids, true ) ) {
-                return false;
-            }
-            domains_ids = new ArrayList<DomainId>();
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            domains_ids.add( new DomainId( "D" ) );
-            if ( !p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( !p.contains( domains_ids, true ) ) {
-                return false;
-            }
-            domains_ids = new ArrayList<DomainId>();
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            domains_ids.add( new DomainId( "D" ) );
-            if ( !p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( p.contains( domains_ids, true ) ) {
-                return false;
-            }
-            domains_ids = new ArrayList<DomainId>();
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            domains_ids.add( new DomainId( "D" ) );
-            if ( !p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( p.contains( domains_ids, true ) ) {
-                return false;
-            }
-            domains_ids = new ArrayList<DomainId>();
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "D" ) );
-            if ( !p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( !p.contains( domains_ids, true ) ) {
-                return false;
-            }
-            domains_ids = new ArrayList<DomainId>();
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            domains_ids.add( new DomainId( "D" ) );
-            domains_ids.add( new DomainId( "X" ) );
-            if ( p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( p.contains( domains_ids, true ) ) {
-                return false;
-            }
-            domains_ids = new ArrayList<DomainId>();
-            domains_ids.add( new DomainId( "X" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            domains_ids.add( new DomainId( "D" ) );
-            if ( p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( p.contains( domains_ids, true ) ) {
-                return false;
-            }
-            domains_ids = new ArrayList<DomainId>();
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "B" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            domains_ids.add( new DomainId( "A" ) );
-            domains_ids.add( new DomainId( "C" ) );
-            domains_ids.add( new DomainId( "D" ) );
-            if ( !p.contains( domains_ids, false ) ) {
-                return false;
-            }
-            if ( p.contains( domains_ids, true ) ) {
-                return false;
-            }
-        }
-        catch ( final Exception e ) {
-            e.printStackTrace( System.out );
-            return false;
-        }
-        return true;
-    }
-
     private static boolean testBinaryDomainCombination() {
         try {
             final BasicBinaryDomainCombination s0 = new BasicBinaryDomainCombination( "a", "a" );
@@ -1601,7 +1238,7 @@ public class TestSurfacing {
             final BasicBinaryDomainCombination s6 = new BasicBinaryDomainCombination( "b", "c" );
             final BasicBinaryDomainCombination s7 = new BasicBinaryDomainCombination( "d", "a" );
             final BasicBinaryDomainCombination s8 = new BasicBinaryDomainCombination( "b", "d" );
-            final BinaryDomainCombination s9 = BasicBinaryDomainCombination.createInstance( " z-z=a-aa " );
+            final BinaryDomainCombination s9 = BasicBinaryDomainCombination.createInstance( "z-z=a-aa" );
             if ( !s9.toString().equals( "a-aa=z-z" ) ) {
                 System.out.println( s9.toString() );
                 return false;
@@ -1633,17 +1270,18 @@ public class TestSurfacing {
             final SortedSet<BasicBinaryDomainCombination> sorted = new TreeSet<BasicBinaryDomainCombination>();
             sorted.add( s0 );
             sorted.add( s1 );
-            sorted.add( s2 );
-            sorted.add( s3 );
-            sorted.add( s3 );
+            sorted.add( s2 );//
             sorted.add( s3 );
-            sorted.add( s4 );
+            sorted.add( s3 );//
+            sorted.add( s3 );//
+            sorted.add( s4 );//
             sorted.add( s5 );
             sorted.add( s6 );
             sorted.add( s7 );
-            sorted.add( s7 );
+            sorted.add( s7 );//
             sorted.add( s8 );
-            if ( sorted.size() != 6 ) {
+            if ( sorted.size() != 7 ) {
+                System.out.println( sorted.size() );
                 return false;
             }
             final DirectedBinaryDomainCombination aa = new DirectedBinaryDomainCombination( "a", "a" );
@@ -1996,7 +1634,7 @@ public class TestSurfacing {
             two.setKeyDomainCount( 3 );
             final PairwiseDomainSimilarityCalculator calc = new DomainCountsBasedPairwiseSimilarityCalculator();
             PairwiseDomainSimilarity s1 = calc.calculateSimilarity( one, two );
-            if ( !TestSurfacing.isEqual( s1.getSimilarityScore(), 1.0 - ( 3 - 2.0 ) / ( 2 + 3 ) ) ) {
+            if ( !TestSurfacing.isEqual( s1.getSimilarityScore(), 1.0 - ( ( 3 - 2.0 ) / ( 2 + 3 ) ) ) ) {
                 return false;
             }
             if ( s1.getDifferenceInCounts() != ( 2 - 3 ) ) {
@@ -2014,7 +1652,7 @@ public class TestSurfacing {
             one.setKeyDomainCount( 1 );
             two.setKeyDomainCount( 1000 );
             s1 = calc.calculateSimilarity( one, two );
-            if ( !TestSurfacing.isEqual( s1.getSimilarityScore(), 1.0 - 999.0 / 1001 ) ) {
+            if ( !TestSurfacing.isEqual( s1.getSimilarityScore(), 1.0 - ( 999.0 / 1001 ) ) ) {
                 return false;
             }
             if ( s1.getDifferenceInCounts() != ( 1 - 1000 ) ) {
@@ -3107,7 +2745,7 @@ public class TestSurfacing {
             if ( !calc_i.getSharedDomains().contains( f.getDomainId() ) ) {
                 return false;
             }
-            final Set<DomainId> all = calc_ni.getAllDomains();
+            final Set<String> all = calc_ni.getAllDomains();
             if ( !all.contains( a.getDomainId() ) ) {
                 return false;
             }
@@ -3435,17 +3073,17 @@ public class TestSurfacing {
                 return false;
             }
             if ( !isEqual( calc_ni.calculateSharedBinaryDomainCombinationBasedGenomeSimilarityScore(),
-                           1.0 - ( 25.0 - 5.0 ) / 25.0 ) ) {
+                           1.0 - ( ( 25.0 - 5.0 ) / 25.0 ) ) ) {
                 return false;
             }
             if ( !isEqual( calc_i.calculateSharedBinaryDomainCombinationBasedGenomeSimilarityScore(),
-                           1.0 - ( 22.0 - 3.0 ) / 22.0 ) ) {
+                           1.0 - ( ( 22.0 - 3.0 ) / 22.0 ) ) ) {
                 return false;
             }
-            if ( !isEqual( calc_ni.calculateSharedDomainsBasedGenomeSimilarityScore(), 1.0 - ( 14.0 - 4.0 ) / 14.0 ) ) {
+            if ( !isEqual( calc_ni.calculateSharedDomainsBasedGenomeSimilarityScore(), 1.0 - ( ( 14.0 - 4.0 ) / 14.0 ) ) ) {
                 return false;
             }
-            if ( !isEqual( calc_i.calculateSharedDomainsBasedGenomeSimilarityScore(), 1.0 - ( 14.0 - 4.0 ) / 14.0 ) ) {
+            if ( !isEqual( calc_i.calculateSharedDomainsBasedGenomeSimilarityScore(), 1.0 - ( ( 14.0 - 4.0 ) / 14.0 ) ) ) {
                 return false;
             }
             final Domain u = new BasicDomain( "u", 23, 25, ( short ) 1, ( short ) 4, 0.1, -12 );
@@ -3582,8 +3220,8 @@ public class TestSurfacing {
             }
             calc_u.setAllowDomainsToBeIgnored( true );
             calc_u.addDomainIdToIgnore( u.getDomainId() );
-            calc_u.addDomainIdToIgnore( new DomainId( "other" ) );
-            calc_u.addDomainIdToIgnore( new DomainId( "other_too" ) );
+            calc_u.addDomainIdToIgnore( "other" );
+            calc_u.addDomainIdToIgnore( "other_too" );
             if ( calc_u.getAllDomains().size() != 5 ) {
                 return false;
             }
@@ -3687,10 +3325,10 @@ public class TestSurfacing {
             //------------
             calc_u.setAllowDomainsToBeIgnored( true );
             calc_u.deleteAllDomainIdsToIgnore();
-            calc_u.addDomainIdToIgnore( new DomainId( "v" ) );
-            calc_u.addDomainIdToIgnore( new DomainId( "w" ) );
-            calc_u.addDomainIdToIgnore( new DomainId( "other" ) );
-            calc_u.addDomainIdToIgnore( new DomainId( "other_too" ) );
+            calc_u.addDomainIdToIgnore( "v" );
+            calc_u.addDomainIdToIgnore( "w" );
+            calc_u.addDomainIdToIgnore( "other" );
+            calc_u.addDomainIdToIgnore( "other_too" );
             if ( calc_u.getAllDomains().size() != 4 ) {
                 return false;
             }
@@ -3761,34 +3399,34 @@ public class TestSurfacing {
                 return false;
             }
             if ( !isEqual( calc_u.calculateSharedBinaryDomainCombinationBasedGenomeSimilarityScore(),
-                           1.0 - ( 1.0 - 1.0 ) / 1.0 ) ) {
+                           1.0 - ( ( 1.0 - 1.0 ) / 1.0 ) ) ) {
                 return false;
             }
-            if ( !isEqual( calc_u.calculateSharedDomainsBasedGenomeSimilarityScore(), 1.0 - ( 4.0 - 3.0 ) / 4.0 ) ) {
+            if ( !isEqual( calc_u.calculateSharedDomainsBasedGenomeSimilarityScore(), 1.0 - ( ( 4.0 - 3.0 ) / 4.0 ) ) ) {
                 return false;
             }
             calc_u.setAllowDomainsToBeIgnored( false );
             if ( !isEqual( calc_u.calculateSharedBinaryDomainCombinationBasedGenomeSimilarityScore(),
-                           1.0 - ( 5.0 - 2.0 ) / 5.0 ) ) {
+                           1.0 - ( ( 5.0 - 2.0 ) / 5.0 ) ) ) {
                 return false;
             }
-            if ( !isEqual( calc_u.calculateSharedDomainsBasedGenomeSimilarityScore(), 1.0 - ( 6.0 - 4.0 ) / 6.0 ) ) {
+            if ( !isEqual( calc_u.calculateSharedDomainsBasedGenomeSimilarityScore(), 1.0 - ( ( 6.0 - 4.0 ) / 6.0 ) ) ) {
                 return false;
             }
             calc_u.setAllowDomainsToBeIgnored( true );
             if ( !isEqual( calc_u.calculateSharedBinaryDomainCombinationBasedGenomeSimilarityScore(),
-                           1.0 - ( 1.0 - 1.0 ) / 1.0 ) ) {
+                           1.0 - ( ( 1.0 - 1.0 ) / 1.0 ) ) ) {
                 return false;
             }
-            if ( !isEqual( calc_u.calculateSharedDomainsBasedGenomeSimilarityScore(), 1.0 - ( 4.0 - 3.0 ) / 4.0 ) ) {
+            if ( !isEqual( calc_u.calculateSharedDomainsBasedGenomeSimilarityScore(), 1.0 - ( ( 4.0 - 3.0 ) / 4.0 ) ) ) {
                 return false;
             }
             calc_u.deleteAllDomainIdsToIgnore();
             if ( !isEqual( calc_u.calculateSharedBinaryDomainCombinationBasedGenomeSimilarityScore(),
-                           1.0 - ( 5.0 - 2.0 ) / 5.0 ) ) {
+                           1.0 - ( ( 5.0 - 2.0 ) / 5.0 ) ) ) {
                 return false;
             }
-            if ( !isEqual( calc_u.calculateSharedDomainsBasedGenomeSimilarityScore(), 1.0 - ( 6.0 - 4.0 ) / 6.0 ) ) {
+            if ( !isEqual( calc_u.calculateSharedDomainsBasedGenomeSimilarityScore(), 1.0 - ( ( 6.0 - 4.0 ) / 6.0 ) ) ) {
                 return false;
             }
         }
@@ -3809,7 +3447,7 @@ public class TestSurfacing {
             final List<Protein> domain_collections = parser.parse();
             final BasicGenomeWideCombinableDomains cdcc = BasicGenomeWideCombinableDomains
                     .createInstance( domain_collections, false, new BasicSpecies( "human" ) );
-            CombinableDomains cd = cdcc.get( new DomainId( "A" ) );
+            CombinableDomains cd = cdcc.get( "A" );
             if ( cd.getKeyDomainCount() != 9 ) {
                 return false;
             }
@@ -3858,7 +3496,7 @@ public class TestSurfacing {
             if ( cd.getKeyDomainCount() != 9 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "B" ) );
+            cd = cdcc.get( "B" );
             if ( cd.getKeyDomainCount() != 12 ) {
                 return false;
             }
@@ -3907,7 +3545,7 @@ public class TestSurfacing {
             if ( cd.getKeyDomainCount() != 12 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "C" ) );
+            cd = cdcc.get( "C" );
             if ( cd.getKeyDomainCount() != 10 ) {
                 return false;
             }
@@ -3953,7 +3591,7 @@ public class TestSurfacing {
             if ( cd.getNumberOfProteinsExhibitingCombination( new SimpleDomain( "NN" ).getDomainId() ) != 0 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "D" ) );
+            cd = cdcc.get( "D" );
             if ( cd.getKeyDomainCount() != 15 ) {
                 return false;
             }
@@ -3963,7 +3601,7 @@ public class TestSurfacing {
             if ( cd.getNumberOfCombinableDomains() != 11 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "E" ) );
+            cd = cdcc.get( "E" );
             if ( cd.getNumberOfCombinableDomains() != 10 ) {
                 return false;
             }
@@ -3973,7 +3611,7 @@ public class TestSurfacing {
             if ( cd.getKeyDomainProteinsCount() != 1 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "U" ) );
+            cd = cdcc.get( "U" );
             if ( cd.getNumberOfCombinableDomains() != 11 ) {
                 return false;
             }
@@ -3983,7 +3621,7 @@ public class TestSurfacing {
             if ( cd.getKeyDomainProteinsCount() != 3 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "V" ) );
+            cd = cdcc.get( "V" );
             if ( cd.getNumberOfCombinableDomains() != 11 ) {
                 return false;
             }
@@ -3993,7 +3631,7 @@ public class TestSurfacing {
             if ( cd.getKeyDomainProteinsCount() != 2 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "W" ) );
+            cd = cdcc.get( "W" );
             if ( cd.getNumberOfCombinableDomains() != 10 ) {
                 return false;
             }
@@ -4003,22 +3641,22 @@ public class TestSurfacing {
             if ( cd.getKeyDomainProteinsCount() != 2 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "X" ) );
+            cd = cdcc.get( "X" );
             if ( cd.getNumberOfCombinableDomains() != 10 ) {
                 return false;
             }
             if ( cd.getKeyDomainCount() != 2 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "Y" ) );
+            cd = cdcc.get( "Y" );
             if ( cd.getNumberOfCombinableDomains() != 10 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "Z" ) );
+            cd = cdcc.get( "Z" );
             if ( cd.getNumberOfCombinableDomains() != 10 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "NN" ) );
+            cd = cdcc.get( "NN" );
             if ( cd.getKeyDomainCount() != 1 ) {
                 return false;
             }
@@ -4031,7 +3669,7 @@ public class TestSurfacing {
             if ( cd.getNumberOfProteinsExhibitingCombination( new SimpleDomain( "NN" ).getDomainId() ) != 0 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "MM" ) );
+            cd = cdcc.get( "MM" );
             if ( cd.getNumberOfCombinableDomains() != 1 ) {
                 return false;
             }
@@ -4041,7 +3679,7 @@ public class TestSurfacing {
             if ( cd.getNumberOfProteinsExhibitingCombination( new SimpleDomain( "OO" ).getDomainId() ) != 1 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "OO" ) );
+            cd = cdcc.get( "OO" );
             if ( cd.getNumberOfCombinableDomains() != 2 ) {
                 return false;
             }
@@ -4051,7 +3689,7 @@ public class TestSurfacing {
             if ( cd.getNumberOfProteinsExhibitingCombination( new SimpleDomain( "MM" ).getDomainId() ) != 1 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "QQ" ) );
+            cd = cdcc.get( "QQ" );
             if ( cd.getNumberOfCombinableDomains() != 1 ) {
                 return false;
             }
@@ -4064,7 +3702,7 @@ public class TestSurfacing {
             if ( cd.getNumberOfProteinsExhibitingCombination( new SimpleDomain( "QQ" ).getDomainId() ) != 3 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "PP" ) );
+            cd = cdcc.get( "PP" );
             if ( cd.getNumberOfCombinableDomains() != 0 ) {
                 return false;
             }
@@ -4074,7 +3712,7 @@ public class TestSurfacing {
             if ( cd.getKeyDomainProteinsCount() != 2 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "singlet" ) );
+            cd = cdcc.get( "singlet" );
             if ( cd.getKeyDomainCount() != 1 ) {
                 return false;
             }
@@ -4087,7 +3725,7 @@ public class TestSurfacing {
             if ( cd.getNumberOfProteinsExhibitingCombination( new SimpleDomain( "singlet" ).getDomainId() ) != 0 ) {
                 return false;
             }
-            cd = cdcc.get( new DomainId( "three" ) );
+            cd = cdcc.get( "three" );
             if ( cd.getKeyDomainCount() != 3 ) {
                 return false;
             }
@@ -4097,10 +3735,10 @@ public class TestSurfacing {
             if ( cd.getNumberOfCombinableDomains() != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "three" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "three" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "so_far_so_bad" ) ) != 0 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "so_far_so_bad" ) != 0 ) {
                 return false;
             }
             // Ignore combinations with same:
@@ -4112,7 +3750,7 @@ public class TestSurfacing {
                                      DomainCombinationType.BASIC,
                                      null,
                                      null );
-            cd = cdcc2.get( new DomainId( "A" ) );
+            cd = cdcc2.get( "A" );
             if ( cd.getKeyDomainCount() != 9 ) {
                 return false;
             }
@@ -4137,28 +3775,28 @@ public class TestSurfacing {
             if ( cd.getNumberOfProteinsExhibitingCombination( new SimpleDomain( "E" ).getDomainId() ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "U" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "U" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "V" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "V" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "W" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "W" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "X" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "X" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "Y" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "Y" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "Z" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "Z" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "NN" ) ) != 0 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "NN" ) != 0 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "B" ) );
+            cd = cdcc2.get( "B" );
             if ( cd.getKeyDomainCount() != 12 ) {
                 return false;
             }
@@ -4168,43 +3806,43 @@ public class TestSurfacing {
             if ( cd.getNumberOfCombinableDomains() != 10 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "A" ) ) != 6 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "A" ) != 6 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "B" ) ) != 0 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "B" ) != 0 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "C" ) ) != 4 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "C" ) != 4 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "D" ) ) != 3 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "D" ) != 3 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "E" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "E" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "U" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "U" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "V" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "V" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "W" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "W" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "X" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "X" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "Y" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "Y" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "Z" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "Z" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "NN" ) ) != 0 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "NN" ) != 0 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "C" ) );
+            cd = cdcc2.get( "C" );
             if ( cd.getKeyDomainCount() != 10 ) {
                 return false;
             }
@@ -4214,112 +3852,112 @@ public class TestSurfacing {
             if ( cd.getNumberOfCombinableDomains() != 10 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "A" ) ) != 4 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "A" ) != 4 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "B" ) ) != 4 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "B" ) != 4 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "C" ) ) != 0 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "C" ) != 0 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "D" ) ) != 3 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "D" ) != 3 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "E" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "E" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "U" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "U" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "V" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "V" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "W" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "W" ) != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "X" ) ) != 2 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "X" ) != 2 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "Y" ) ) != 2 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "Y" ) != 2 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "Z" ) ) != 2 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "Z" ) != 2 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "NN" ) ) != 0 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "NN" ) != 0 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "D" ) );
+            cd = cdcc2.get( "D" );
             if ( cd.getNumberOfCombinableDomains() != 10 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "E" ) );
+            cd = cdcc2.get( "E" );
             if ( cd.getNumberOfCombinableDomains() != 10 ) {
                 return false;
             }
             if ( cd.getKeyDomainCount() != 1 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "U" ) );
+            cd = cdcc2.get( "U" );
             if ( cd.getNumberOfCombinableDomains() != 10 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "V" ) );
+            cd = cdcc2.get( "V" );
             if ( cd.getNumberOfCombinableDomains() != 10 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "W" ) );
+            cd = cdcc2.get( "W" );
             if ( cd.getNumberOfCombinableDomains() != 10 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "X" ) );
+            cd = cdcc2.get( "X" );
             if ( cd.getNumberOfCombinableDomains() != 10 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "Y" ) );
+            cd = cdcc2.get( "Y" );
             if ( cd.getNumberOfCombinableDomains() != 10 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "Z" ) );
+            cd = cdcc2.get( "Z" );
             if ( cd.getNumberOfCombinableDomains() != 10 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "NN" ) );
+            cd = cdcc2.get( "NN" );
             if ( cd.getNumberOfCombinableDomains() != 0 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "NN" ) ) != 0 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "NN" ) != 0 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "MM" ) );
+            cd = cdcc2.get( "MM" );
             if ( cd.getNumberOfCombinableDomains() != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "MM" ) ) != 0 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "MM" ) != 0 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "OO" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "OO" ) != 1 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "OO" ) );
+            cd = cdcc2.get( "OO" );
             if ( cd.getNumberOfCombinableDomains() != 1 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "OO" ) ) != 0 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "OO" ) != 0 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "MM" ) ) != 1 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "MM" ) != 1 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "QQ" ) );
+            cd = cdcc2.get( "QQ" );
             if ( cd.getNumberOfCombinableDomains() != 0 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "QQ" ) ) != 0 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "QQ" ) != 0 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "singlet" ) );
+            cd = cdcc2.get( "singlet" );
             if ( cd.getKeyDomainCount() != 1 ) {
                 return false;
             }
@@ -4329,10 +3967,10 @@ public class TestSurfacing {
             if ( cd.getNumberOfCombinableDomains() != 0 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "singlet" ) ) != 0 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "singlet" ) != 0 ) {
                 return false;
             }
-            cd = cdcc2.get( new DomainId( "three" ) );
+            cd = cdcc2.get( "three" );
             if ( cd.getKeyDomainCount() != 3 ) {
                 return false;
             }
@@ -4342,73 +3980,10 @@ public class TestSurfacing {
             if ( cd.getNumberOfCombinableDomains() != 0 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "three" ) ) != 0 ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "three" ) != 0 ) {
                 return false;
             }
-            if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "so_far_so_bad" ) ) != 0 ) {
-                return false;
-            }
-        }
-        catch ( final Exception e ) {
-            e.printStackTrace( System.out );
-            return false;
-        }
-        return true;
-    }
-
-    private static boolean testDomainId() {
-        try {
-            final DomainId id1 = new DomainId( "a" );
-            final DomainId id2 = new DomainId( "a" );
-            final DomainId id3 = new DomainId( "A" );
-            final DomainId id4 = new DomainId( "b" );
-            if ( !id1.equals( id1 ) ) {
-                return false;
-            }
-            if ( id1.getId().equals( "x" ) ) {
-                return false;
-            }
-            if ( id1.getId().equals( null ) ) {
-                return false;
-            }
-            if ( !id1.equals( id2 ) ) {
-                return false;
-            }
-            if ( id1.equals( id3 ) ) {
-                return false;
-            }
-            if ( id1.hashCode() != id1.hashCode() ) {
-                return false;
-            }
-            if ( id1.hashCode() != id2.hashCode() ) {
-                return false;
-            }
-            if ( id1.hashCode() == id3.hashCode() ) {
-                return false;
-            }
-            if ( id1.compareTo( id1 ) != 0 ) {
-                return false;
-            }
-            if ( id1.compareTo( id2 ) != 0 ) {
-                return false;
-            }
-            if ( id1.compareTo( id3 ) != 0 ) {
-                return false;
-            }
-            if ( id1.compareTo( id4 ) >= 0 ) {
-                return false;
-            }
-            if ( id4.compareTo( id1 ) <= 0 ) {
-                return false;
-            }
-            if ( !id4.getId().equals( "b" ) ) {
-                return false;
-            }
-            final DomainId id5 = new DomainId( " C " );
-            if ( !id5.getId().equals( "C" ) ) {
-                return false;
-            }
-            if ( id5.equals( id1 ) ) {
+            if ( cd.getNumberOfProteinsExhibitingCombination( "so_far_so_bad" ) != 0 ) {
                 return false;
             }
         }
@@ -4464,73 +4039,73 @@ public class TestSurfacing {
             if ( sorted.size() != 17 ) {
                 return false;
             }
-            if ( !sorted.get( 0 ).getDomainId().getId().equals( "A" ) ) {
+            if ( !sorted.get( 0 ).getDomainId().equals( "A" ) ) {
                 return false;
             }
             if ( sorted.get( 0 ).getNumber() != 1 ) {
                 return false;
             }
-            if ( !sorted.get( 1 ).getDomainId().getId().equals( "B" ) ) {
+            if ( !sorted.get( 1 ).getDomainId().equals( "B" ) ) {
                 return false;
             }
             if ( sorted.get( 1 ).getNumber() != 1 ) {
                 return false;
             }
-            if ( !sorted.get( 2 ).getDomainId().getId().equals( "C" ) ) {
+            if ( !sorted.get( 2 ).getDomainId().equals( "C" ) ) {
                 return false;
             }
             if ( sorted.get( 2 ).getNumber() != 1 ) {
                 return false;
             }
-            if ( !sorted.get( 3 ).getDomainId().getId().equals( "D" ) ) {
+            if ( !sorted.get( 3 ).getDomainId().equals( "D" ) ) {
                 return false;
             }
             if ( sorted.get( 3 ).getNumber() != 1 ) {
                 return false;
             }
-            if ( !sorted.get( 4 ).getDomainId().getId().equals( "E" ) ) {
+            if ( !sorted.get( 4 ).getDomainId().equals( "E" ) ) {
                 return false;
             }
             if ( sorted.get( 4 ).getNumber() != 1 ) {
                 return false;
             }
-            if ( !sorted.get( 5 ).getDomainId().getId().equals( "F" ) ) {
+            if ( !sorted.get( 5 ).getDomainId().equals( "F" ) ) {
                 return false;
             }
             if ( sorted.get( 5 ).getNumber() != 1 ) {
                 return false;
             }
-            if ( !sorted.get( 6 ).getDomainId().getId().equals( "G" ) ) {
+            if ( !sorted.get( 6 ).getDomainId().equals( "G" ) ) {
                 return false;
             }
             if ( sorted.get( 6 ).getNumber() != 1 ) {
                 return false;
             }
-            if ( !sorted.get( 7 ).getDomainId().getId().equals( "H" ) ) {
+            if ( !sorted.get( 7 ).getDomainId().equals( "H" ) ) {
                 return false;
             }
             if ( sorted.get( 7 ).getNumber() != 5 ) {
                 return false;
             }
-            if ( !sorted.get( 8 ).getDomainId().getId().equals( "H" ) ) {
+            if ( !sorted.get( 8 ).getDomainId().equals( "H" ) ) {
                 return false;
             }
             if ( sorted.get( 8 ).getNumber() != 2 ) {
                 return false;
             }
-            if ( !sorted.get( 9 ).getDomainId().getId().equals( "H" ) ) {
+            if ( !sorted.get( 9 ).getDomainId().equals( "H" ) ) {
                 return false;
             }
             if ( sorted.get( 9 ).getNumber() != 6 ) {
                 return false;
             }
-            if ( !sorted.get( 10 ).getDomainId().getId().equals( "H" ) ) {
+            if ( !sorted.get( 10 ).getDomainId().equals( "H" ) ) {
                 return false;
             }
             if ( sorted.get( 10 ).getNumber() != 4 ) {
                 return false;
             }
-            if ( !sorted.get( 11 ).getDomainId().getId().equals( "H" ) ) {
+            if ( !sorted.get( 11 ).getDomainId().equals( "H" ) ) {
                 return false;
             }
             if ( sorted.get( 11 ).getNumber() != 1 ) {
@@ -4539,25 +4114,25 @@ public class TestSurfacing {
             if ( sorted.get( 11 ).getTotalCount() != 5 ) {
                 return false;
             }
-            if ( !sorted.get( 12 ).getDomainId().getId().equals( "H" ) ) {
+            if ( !sorted.get( 12 ).getDomainId().equals( "H" ) ) {
                 return false;
             }
             if ( sorted.get( 12 ).getNumber() != 3 ) {
                 return false;
             }
-            if ( !sorted.get( 13 ).getDomainId().getId().equals( "H7" ) ) {
+            if ( !sorted.get( 13 ).getDomainId().equals( "H7" ) ) {
                 return false;
             }
             if ( sorted.get( 13 ).getNumber() != 5 ) {
                 return false;
             }
-            if ( !sorted.get( 14 ).getDomainId().getId().equals( "H7" ) ) {
+            if ( !sorted.get( 14 ).getDomainId().equals( "H7" ) ) {
                 return false;
             }
             if ( sorted.get( 14 ).getNumber() != 5 ) {
                 return false;
             }
-            if ( !sorted.get( 15 ).getDomainId().getId().equals( "H7" ) ) {
+            if ( !sorted.get( 15 ).getDomainId().equals( "H7" ) ) {
                 return false;
             }
             if ( sorted.get( 15 ).getNumber() != 5 ) {
@@ -4565,7 +4140,7 @@ public class TestSurfacing {
             }
             // To check if sorting is stable [as claimed by Sun for
             // Collections.sort( List )]
-            if ( !sorted.get( 16 ).getDomainId().getId().equals( "H7" ) ) {
+            if ( !sorted.get( 16 ).getDomainId().equals( "H7" ) ) {
                 return false;
             }
             if ( sorted.get( 16 ).getNumber() != 5 ) {
@@ -4582,105 +4157,6 @@ public class TestSurfacing {
         return true;
     }
 
-    private static boolean testEngulfingOverlapRemoval() {
-        try {
-            final Domain d0 = new BasicDomain( "d0", 0, 8, ( short ) 1, ( short ) 1, 0.1, 1 );
-            final Domain d1 = new BasicDomain( "d1", 0, 1, ( short ) 1, ( short ) 1, 0.1, 1 );
-            final Domain d2 = new BasicDomain( "d2", 0, 2, ( short ) 1, ( short ) 1, 0.1, 1 );
-            final Domain d3 = new BasicDomain( "d3", 7, 8, ( short ) 1, ( short ) 1, 0.1, 1 );
-            final Domain d4 = new BasicDomain( "d4", 7, 9, ( short ) 1, ( short ) 1, 0.1, 1 );
-            final Domain d5 = new BasicDomain( "d4", 0, 9, ( short ) 1, ( short ) 1, 0.1, 1 );
-            final Domain d6 = new BasicDomain( "d4", 4, 5, ( short ) 1, ( short ) 1, 0.1, 1 );
-            final List<Boolean> covered = new ArrayList<Boolean>();
-            covered.add( true ); // 0
-            covered.add( false ); // 1
-            covered.add( true ); // 2
-            covered.add( false ); // 3
-            covered.add( true ); // 4
-            covered.add( true ); // 5
-            covered.add( false ); // 6
-            covered.add( true ); // 7
-            covered.add( true ); // 8
-            if ( SurfacingUtil.isEngulfed( d0, covered ) ) {
-                return false;
-            }
-            if ( SurfacingUtil.isEngulfed( d1, covered ) ) {
-                return false;
-            }
-            if ( SurfacingUtil.isEngulfed( d2, covered ) ) {
-                return false;
-            }
-            if ( !SurfacingUtil.isEngulfed( d3, covered ) ) {
-                return false;
-            }
-            if ( SurfacingUtil.isEngulfed( d4, covered ) ) {
-                return false;
-            }
-            if ( SurfacingUtil.isEngulfed( d5, covered ) ) {
-                return false;
-            }
-            if ( !SurfacingUtil.isEngulfed( d6, covered ) ) {
-                return false;
-            }
-            final Domain a = new BasicDomain( "a", 0, 10, ( short ) 1, ( short ) 1, 0.1, 1 );
-            final Domain b = new BasicDomain( "b", 8, 20, ( short ) 1, ( short ) 1, 0.2, 1 );
-            final Domain c = new BasicDomain( "c", 15, 16, ( short ) 1, ( short ) 1, 0.3, 1 );
-            final Protein abc = new BasicProtein( "abc", "nemve", 0 );
-            abc.addProteinDomain( a );
-            abc.addProteinDomain( b );
-            abc.addProteinDomain( c );
-            final Protein abc_r1 = SurfacingUtil.removeOverlappingDomains( 3, false, abc );
-            final Protein abc_r2 = SurfacingUtil.removeOverlappingDomains( 3, true, abc );
-            if ( abc.getNumberOfProteinDomains() != 3 ) {
-                return false;
-            }
-            if ( abc_r1.getNumberOfProteinDomains() != 3 ) {
-                return false;
-            }
-            if ( abc_r2.getNumberOfProteinDomains() != 2 ) {
-                return false;
-            }
-            if ( !abc_r2.getProteinDomain( 0 ).getDomainId().getId().equals( "a" ) ) {
-                return false;
-            }
-            if ( !abc_r2.getProteinDomain( 1 ).getDomainId().getId().equals( "b" ) ) {
-                return false;
-            }
-            final Domain d = new BasicDomain( "d", 0, 10, ( short ) 1, ( short ) 1, 0.1, 1 );
-            final Domain e = new BasicDomain( "e", 8, 20, ( short ) 1, ( short ) 1, 0.3, 1 );
-            final Domain f = new BasicDomain( "f", 15, 16, ( short ) 1, ( short ) 1, 0.2, 1 );
-            final Protein def = new BasicProtein( "def", "nemve", 0 );
-            def.addProteinDomain( d );
-            def.addProteinDomain( e );
-            def.addProteinDomain( f );
-            final Protein def_r1 = SurfacingUtil.removeOverlappingDomains( 5, false, def );
-            final Protein def_r2 = SurfacingUtil.removeOverlappingDomains( 5, true, def );
-            if ( def.getNumberOfProteinDomains() != 3 ) {
-                return false;
-            }
-            if ( def_r1.getNumberOfProteinDomains() != 3 ) {
-                return false;
-            }
-            if ( def_r2.getNumberOfProteinDomains() != 3 ) {
-                return false;
-            }
-            if ( !def_r2.getProteinDomain( 0 ).getDomainId().getId().equals( "d" ) ) {
-                return false;
-            }
-            if ( !def_r2.getProteinDomain( 1 ).getDomainId().getId().equals( "f" ) ) {
-                return false;
-            }
-            if ( !def_r2.getProteinDomain( 2 ).getDomainId().getId().equals( "e" ) ) {
-                return false;
-            }
-        }
-        catch ( final Exception e ) {
-            e.printStackTrace( System.out );
-            return false;
-        }
-        return true;
-    }
-
     private static boolean testGenomeWideCombinableDomains() {
         try {
             final Domain a = new BasicDomain( "a", 23, 25, ( short ) 1, ( short ) 4, 0.1, -12 );
@@ -4730,58 +4206,58 @@ public class TestSurfacing {
                     .createInstance( protein_list_eel, false, new BasicSpecies( "eel" ) );
             final BasicGenomeWideCombinableDomains eel_ignore = BasicGenomeWideCombinableDomains
                     .createInstance( protein_list_eel, true, new BasicSpecies( "eel" ) );
-            if ( !eel_not_ignore.contains( new DomainId( "a" ) ) ) {
+            if ( !eel_not_ignore.contains( "a" ) ) {
                 return false;
             }
-            if ( !eel_not_ignore.contains( new DomainId( "b" ) ) ) {
+            if ( !eel_not_ignore.contains( "b" ) ) {
                 return false;
             }
-            if ( !eel_not_ignore.contains( new DomainId( "c" ) ) ) {
+            if ( !eel_not_ignore.contains( "c" ) ) {
                 return false;
             }
-            if ( !eel_not_ignore.contains( new DomainId( "d" ) ) ) {
+            if ( !eel_not_ignore.contains( "d" ) ) {
                 return false;
             }
-            if ( !eel_not_ignore.contains( new DomainId( "e" ) ) ) {
+            if ( !eel_not_ignore.contains( "e" ) ) {
                 return false;
             }
-            if ( !eel_not_ignore.contains( new DomainId( "f" ) ) ) {
+            if ( !eel_not_ignore.contains( "f" ) ) {
                 return false;
             }
-            if ( !eel_not_ignore.contains( new DomainId( "g" ) ) ) {
+            if ( !eel_not_ignore.contains( "g" ) ) {
                 return false;
             }
-            if ( !eel_not_ignore.contains( new DomainId( "h" ) ) ) {
+            if ( !eel_not_ignore.contains( "h" ) ) {
                 return false;
             }
-            if ( eel_not_ignore.contains( new DomainId( "x" ) ) ) {
+            if ( eel_not_ignore.contains( "x" ) ) {
                 return false;
             }
-            if ( !eel_ignore.contains( new DomainId( "a" ) ) ) {
+            if ( !eel_ignore.contains( "a" ) ) {
                 return false;
             }
-            if ( !eel_ignore.contains( new DomainId( "b" ) ) ) {
+            if ( !eel_ignore.contains( "b" ) ) {
                 return false;
             }
-            if ( !eel_ignore.contains( new DomainId( "c" ) ) ) {
+            if ( !eel_ignore.contains( "c" ) ) {
                 return false;
             }
-            if ( !eel_ignore.contains( new DomainId( "d" ) ) ) {
+            if ( !eel_ignore.contains( "d" ) ) {
                 return false;
             }
-            if ( !eel_ignore.contains( new DomainId( "e" ) ) ) {
+            if ( !eel_ignore.contains( "e" ) ) {
                 return false;
             }
-            if ( !eel_ignore.contains( new DomainId( "f" ) ) ) {
+            if ( !eel_ignore.contains( "f" ) ) {
                 return false;
             }
-            if ( !eel_ignore.contains( new DomainId( "g" ) ) ) {
+            if ( !eel_ignore.contains( "g" ) ) {
                 return false;
             }
-            if ( !eel_ignore.contains( new DomainId( "h" ) ) ) {
+            if ( !eel_ignore.contains( "h" ) ) {
                 return false;
             }
-            if ( eel_ignore.contains( new DomainId( "x" ) ) ) {
+            if ( eel_ignore.contains( "x" ) ) {
                 return false;
             }
             if ( eel_not_ignore.getSize() != 8 ) {
@@ -4790,52 +4266,52 @@ public class TestSurfacing {
             if ( eel_ignore.getSize() != 8 ) {
                 return false;
             }
-            if ( eel_not_ignore.get( new DomainId( "a" ) ).getCombinableDomainsIds().size() != 5 ) {
+            if ( eel_not_ignore.get( "a" ).getCombinableDomainsIds().size() != 5 ) {
                 return false;
             }
-            if ( eel_not_ignore.get( new DomainId( "b" ) ).getCombinableDomainsIds().size() != 4 ) {
+            if ( eel_not_ignore.get( "b" ).getCombinableDomainsIds().size() != 4 ) {
                 return false;
             }
-            if ( eel_not_ignore.get( new DomainId( "c" ) ).getCombinableDomainsIds().size() != 4 ) {
+            if ( eel_not_ignore.get( "c" ).getCombinableDomainsIds().size() != 4 ) {
                 return false;
             }
-            if ( eel_not_ignore.get( new DomainId( "d" ) ).getCombinableDomainsIds().size() != 4 ) {
+            if ( eel_not_ignore.get( "d" ).getCombinableDomainsIds().size() != 4 ) {
                 return false;
             }
-            if ( eel_not_ignore.get( new DomainId( "e" ) ).getCombinableDomainsIds().size() != 6 ) {
+            if ( eel_not_ignore.get( "e" ).getCombinableDomainsIds().size() != 6 ) {
                 return false;
             }
-            if ( eel_not_ignore.get( new DomainId( "f" ) ).getCombinableDomainsIds().size() != 2 ) {
+            if ( eel_not_ignore.get( "f" ).getCombinableDomainsIds().size() != 2 ) {
                 return false;
             }
-            if ( eel_not_ignore.get( new DomainId( "g" ) ).getCombinableDomainsIds().size() != 1 ) {
+            if ( eel_not_ignore.get( "g" ).getCombinableDomainsIds().size() != 1 ) {
                 return false;
             }
-            if ( eel_not_ignore.get( new DomainId( "h" ) ).getCombinableDomainsIds().size() != 1 ) {
+            if ( eel_not_ignore.get( "h" ).getCombinableDomainsIds().size() != 1 ) {
                 return false;
             }
-            if ( eel_ignore.get( new DomainId( "a" ) ).getCombinableDomainsIds().size() != 4 ) {
+            if ( eel_ignore.get( "a" ).getCombinableDomainsIds().size() != 4 ) {
                 return false;
             }
-            if ( eel_ignore.get( new DomainId( "b" ) ).getCombinableDomainsIds().size() != 4 ) {
+            if ( eel_ignore.get( "b" ).getCombinableDomainsIds().size() != 4 ) {
                 return false;
             }
-            if ( eel_ignore.get( new DomainId( "c" ) ).getCombinableDomainsIds().size() != 4 ) {
+            if ( eel_ignore.get( "c" ).getCombinableDomainsIds().size() != 4 ) {
                 return false;
             }
-            if ( eel_ignore.get( new DomainId( "d" ) ).getCombinableDomainsIds().size() != 4 ) {
+            if ( eel_ignore.get( "d" ).getCombinableDomainsIds().size() != 4 ) {
                 return false;
             }
-            if ( eel_ignore.get( new DomainId( "e" ) ).getCombinableDomainsIds().size() != 5 ) {
+            if ( eel_ignore.get( "e" ).getCombinableDomainsIds().size() != 5 ) {
                 return false;
             }
-            if ( eel_ignore.get( new DomainId( "f" ) ).getCombinableDomainsIds().size() != 1 ) {
+            if ( eel_ignore.get( "f" ).getCombinableDomainsIds().size() != 1 ) {
                 return false;
             }
-            if ( eel_ignore.get( new DomainId( "g" ) ).getCombinableDomainsIds().size() != 1 ) {
+            if ( eel_ignore.get( "g" ).getCombinableDomainsIds().size() != 1 ) {
                 return false;
             }
-            if ( eel_ignore.get( new DomainId( "h" ) ).getCombinableDomainsIds().size() != 1 ) {
+            if ( eel_ignore.get( "h" ).getCombinableDomainsIds().size() != 1 ) {
                 return false;
             }
             if ( eel_not_ignore.getAllDomainIds().size() != 8 ) {
@@ -5079,9 +4555,9 @@ public class TestSurfacing {
                     .equals( "pep:known chromosome:NCBI36:21:16024215:16174248:1 gene:ENSG00000155313 transcript:ENST00000285681" ) ) {
                 return false;
             }
-            final List<Domain> uba = pdc.getProteinDomains( new DomainId( "UBA" ) );
-            final List<Domain> uim = pdc.getProteinDomains( new DomainId( "UIM" ) );
-            final List<Domain> uch = pdc.getProteinDomains( new DomainId( "UCH" ) );
+            final List<Domain> uba = pdc.getProteinDomains( "UBA" );
+            final List<Domain> uim = pdc.getProteinDomains( "UIM" );
+            final List<Domain> uch = pdc.getProteinDomains( "UCH" );
             if ( uba.size() != 1 ) {
                 return false;
             }
@@ -5092,14 +4568,14 @@ public class TestSurfacing {
                 return false;
             }
             final BasicDomain uim_domain = ( BasicDomain ) uim.get( 1 );
-            if ( !uim_domain.getDomainId().equals( new DomainId( "UIM" ) ) ) {
+            if ( !uim_domain.getDomainId().equals( "UIM" ) ) {
                 return false;
             }
             if ( uim_domain.getTotalCount() != 2 ) {
                 return false;
             }
             final BasicDomain uba_domain = ( BasicDomain ) uba.get( 0 );
-            if ( !uba_domain.getDomainId().equals( new DomainId( "UBA" ) ) ) {
+            if ( !uba_domain.getDomainId().equals( "UBA" ) ) {
                 return false;
             }
             if ( uba_domain.getNumber() != 1 ) {
@@ -5166,9 +4642,9 @@ public class TestSurfacing {
             if ( pdc2.getNumberOfProteinDomains() != 3 ) {
                 return false;
             }
-            final List<Domain> uba2 = pdc2.getProteinDomains( new DomainId( "UBA" ) );
-            final List<Domain> uim2 = pdc2.getProteinDomains( new DomainId( "UIM" ) );
-            final List<Domain> uch2 = pdc2.getProteinDomains( new DomainId( "UCH" ) );
+            final List<Domain> uba2 = pdc2.getProteinDomains( "UBA" );
+            final List<Domain> uim2 = pdc2.getProteinDomains( "UIM" );
+            final List<Domain> uch2 = pdc2.getProteinDomains( "UCH" );
             if ( uba2.size() != 1 ) {
                 return false;
             }
@@ -5179,14 +4655,14 @@ public class TestSurfacing {
                 return false;
             }
             final BasicDomain uim_domain2 = ( BasicDomain ) uim2.get( 1 );
-            if ( !uim_domain2.getDomainId().getId().equals( "UIM" ) ) {
+            if ( !uim_domain2.getDomainId().equals( "UIM" ) ) {
                 return false;
             }
             if ( uim_domain2.getTotalCount() != 2 ) {
                 return false;
             }
             final BasicDomain uba_domain2 = ( BasicDomain ) uba2.get( 0 );
-            if ( !uba_domain2.getDomainId().getId().equals( "UBA" ) ) {
+            if ( !uba_domain2.getDomainId().equals( "UBA" ) ) {
                 return false;
             }
             if ( uba_domain2.getNumber() != 1 ) {
@@ -5228,9 +4704,9 @@ public class TestSurfacing {
                 return false;
             }
             //
-            Set<DomainId> filter = new TreeSet<DomainId>();
-            filter.add( new DomainId( "beauty" ) );
-            filter.add( new DomainId( "strange" ) );
+            Set<String> filter = new TreeSet<String>();
+            filter.add( "beauty" );
+            filter.add( "strange" );
             parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
                                               "human",
                                               "ls",
@@ -5248,9 +4724,9 @@ public class TestSurfacing {
                 return false;
             }
             //
-            filter = new TreeSet<DomainId>();
-            filter.add( new DomainId( "beauty" ) );
-            filter.add( new DomainId( "strange" ) );
+            filter = new TreeSet<String>();
+            filter.add( "beauty" );
+            filter.add( "strange" );
             parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
                                               "human",
                                               "ls",
@@ -5268,10 +4744,10 @@ public class TestSurfacing {
                 return false;
             }
             //
-            filter = new TreeSet<DomainId>();
-            filter.add( new DomainId( "UIM" ) );
-            filter.add( new DomainId( "A" ) );
-            filter.add( new DomainId( "C" ) );
+            filter = new TreeSet<String>();
+            filter.add( "UIM" );
+            filter.add( "A" );
+            filter.add( "C" );
             parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
                                               "human",
                                               "ls",
@@ -5289,11 +4765,11 @@ public class TestSurfacing {
                 return false;
             }
             //
-            filter = new TreeSet<DomainId>();
-            filter.add( new DomainId( "UIM" ) );
-            filter.add( new DomainId( "A" ) );
-            filter.add( new DomainId( "C" ) );
-            filter.add( new DomainId( "X" ) );
+            filter = new TreeSet<String>();
+            filter.add( "UIM" );
+            filter.add( "A" );
+            filter.add( "C" );
+            filter.add( "X" );
             parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
                                               "human",
                                               "ls",
@@ -5311,10 +4787,10 @@ public class TestSurfacing {
                 return false;
             }
             //
-            filter = new TreeSet<DomainId>();
-            filter.add( new DomainId( "UIM" ) );
-            filter.add( new DomainId( "A" ) );
-            filter.add( new DomainId( "C" ) );
+            filter = new TreeSet<String>();
+            filter.add( "UIM" );
+            filter.add( "A" );
+            filter.add( "C" );
             parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
                                               "human",
                                               "ls",
@@ -5332,8 +4808,8 @@ public class TestSurfacing {
                 return false;
             }
             //
-            filter = new TreeSet<DomainId>();
-            filter.add( new DomainId( "UIM" ) );
+            filter = new TreeSet<String>();
+            filter.add( "UIM" );
             parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
                                               "human",
                                               "ls",
@@ -5354,8 +4830,8 @@ public class TestSurfacing {
                 return false;
             }
             //
-            filter = new TreeSet<DomainId>();
-            filter.add( new DomainId( "UIM" ) );
+            filter = new TreeSet<String>();
+            filter.add( "UIM" );
             parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
                                               "human",
                                               "ls",
@@ -5376,9 +4852,9 @@ public class TestSurfacing {
                 return false;
             }
             //
-            filter = new TreeSet<DomainId>();
-            filter.add( new DomainId( "A" ) );
-            filter.add( new DomainId( "C" ) );
+            filter = new TreeSet<String>();
+            filter.add( "A" );
+            filter.add( "C" );
             parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
                                               "human",
                                               "ls",
@@ -5412,160 +4888,6 @@ public class TestSurfacing {
         return true;
     }
 
-    private static boolean testOverlapRemoval() {
-        try {
-            final Domain d0 = new BasicDomain( "d0", ( short ) 2, ( short ) 5, ( short ) 1, ( short ) 1, 0.1, 1 );
-            final Domain d1 = new BasicDomain( "d1", ( short ) 7, ( short ) 10, ( short ) 1, ( short ) 1, 0.1, 1 );
-            final Domain d2 = new BasicDomain( "d2", ( short ) 0, ( short ) 20, ( short ) 1, ( short ) 1, 0.1, 1 );
-            final Domain d3 = new BasicDomain( "d3", ( short ) 9, ( short ) 10, ( short ) 1, ( short ) 1, 0.1, 1 );
-            final Domain d4 = new BasicDomain( "d4", ( short ) 7, ( short ) 8, ( short ) 1, ( short ) 1, 0.1, 1 );
-            final List<Boolean> covered = new ArrayList<Boolean>();
-            covered.add( true ); // 0
-            covered.add( false ); // 1
-            covered.add( true ); // 2
-            covered.add( false ); // 3
-            covered.add( true ); // 4
-            covered.add( true ); // 5
-            covered.add( false ); // 6
-            covered.add( true ); // 7
-            covered.add( true ); // 8
-            if ( SurfacingUtil.calculateOverlap( d0, covered ) != 3 ) {
-                return false;
-            }
-            if ( SurfacingUtil.calculateOverlap( d1, covered ) != 2 ) {
-                return false;
-            }
-            if ( SurfacingUtil.calculateOverlap( d2, covered ) != 6 ) {
-                return false;
-            }
-            if ( SurfacingUtil.calculateOverlap( d3, covered ) != 0 ) {
-                return false;
-            }
-            if ( SurfacingUtil.calculateOverlap( d4, covered ) != 2 ) {
-                return false;
-            }
-            final Domain a = new BasicDomain( "a", ( short ) 2, ( short ) 5, ( short ) 1, ( short ) 1, 0.01, 1 );
-            final Domain b = new BasicDomain( "b", ( short ) 2, ( short ) 10, ( short ) 1, ( short ) 1, 0.1, 1 );
-            final Protein ab = new BasicProtein( "ab", "varanus", 0 );
-            ab.addProteinDomain( a );
-            ab.addProteinDomain( b );
-            final Protein ab_s0 = SurfacingUtil.removeOverlappingDomains( 3, false, ab );
-            if ( ab.getNumberOfProteinDomains() != 2 ) {
-                return false;
-            }
-            if ( ab_s0.getNumberOfProteinDomains() != 1 ) {
-                return false;
-            }
-            if ( !ab_s0.getProteinDomain( 0 ).getDomainId().getId().equals( "a" ) ) {
-                return false;
-            }
-            final Protein ab_s1 = SurfacingUtil.removeOverlappingDomains( 4, false, ab );
-            if ( ab.getNumberOfProteinDomains() != 2 ) {
-                return false;
-            }
-            if ( ab_s1.getNumberOfProteinDomains() != 2 ) {
-                return false;
-            }
-            final Domain c = new BasicDomain( "c", ( short ) 20000, ( short ) 20500, ( short ) 1, ( short ) 1, 10, 1 );
-            final Domain d = new BasicDomain( "d",
-                                              ( short ) 10000,
-                                              ( short ) 10500,
-                                              ( short ) 1,
-                                              ( short ) 1,
-                                              0.0000001,
-                                              1 );
-            final Domain e = new BasicDomain( "e", ( short ) 5000, ( short ) 5500, ( short ) 1, ( short ) 1, 0.0001, 1 );
-            final Protein cde = new BasicProtein( "cde", "varanus", 0 );
-            cde.addProteinDomain( c );
-            cde.addProteinDomain( d );
-            cde.addProteinDomain( e );
-            final Protein cde_s0 = SurfacingUtil.removeOverlappingDomains( 0, false, cde );
-            if ( cde.getNumberOfProteinDomains() != 3 ) {
-                return false;
-            }
-            if ( cde_s0.getNumberOfProteinDomains() != 3 ) {
-                return false;
-            }
-            final Domain f = new BasicDomain( "f", ( short ) 10, ( short ) 20, ( short ) 1, ( short ) 1, 10, 1 );
-            final Domain g = new BasicDomain( "g", ( short ) 10, ( short ) 20, ( short ) 1, ( short ) 1, 0.01, 1 );
-            final Domain h = new BasicDomain( "h", ( short ) 10, ( short ) 20, ( short ) 1, ( short ) 1, 0.0001, 1 );
-            final Domain i = new BasicDomain( "i", ( short ) 10, ( short ) 20, ( short ) 1, ( short ) 1, 0.5, 1 );
-            final Domain i2 = new BasicDomain( "i", ( short ) 5, ( short ) 30, ( short ) 1, ( short ) 1, 0.5, 10 );
-            final Protein fghi = new BasicProtein( "fghi", "varanus", 0 );
-            fghi.addProteinDomain( f );
-            fghi.addProteinDomain( g );
-            fghi.addProteinDomain( h );
-            fghi.addProteinDomain( i );
-            fghi.addProteinDomain( i );
-            fghi.addProteinDomain( i );
-            fghi.addProteinDomain( i2 );
-            final Protein fghi_s0 = SurfacingUtil.removeOverlappingDomains( 10, false, fghi );
-            if ( fghi.getNumberOfProteinDomains() != 7 ) {
-                return false;
-            }
-            if ( fghi_s0.getNumberOfProteinDomains() != 1 ) {
-                return false;
-            }
-            if ( !fghi_s0.getProteinDomain( 0 ).getDomainId().getId().equals( "h" ) ) {
-                return false;
-            }
-            final Protein fghi_s1 = SurfacingUtil.removeOverlappingDomains( 11, false, fghi );
-            if ( fghi.getNumberOfProteinDomains() != 7 ) {
-                return false;
-            }
-            if ( fghi_s1.getNumberOfProteinDomains() != 7 ) {
-                return false;
-            }
-            final Domain j = new BasicDomain( "j", ( short ) 10, ( short ) 20, ( short ) 1, ( short ) 1, 10, 1 );
-            final Domain k = new BasicDomain( "k", ( short ) 10, ( short ) 20, ( short ) 1, ( short ) 1, 0.01, 1 );
-            final Domain l = new BasicDomain( "l", ( short ) 10, ( short ) 20, ( short ) 1, ( short ) 1, 0.0001, 1 );
-            final Domain m = new BasicDomain( "m", ( short ) 10, ( short ) 20, ( short ) 1, ( short ) 4, 0.5, 1 );
-            final Domain m0 = new BasicDomain( "m", ( short ) 10, ( short ) 20, ( short ) 2, ( short ) 4, 0.5, 1 );
-            final Domain m1 = new BasicDomain( "m", ( short ) 10, ( short ) 20, ( short ) 3, ( short ) 4, 0.5, 1 );
-            final Domain m2 = new BasicDomain( "m", ( short ) 5, ( short ) 30, ( short ) 4, ( short ) 4, 0.5, 10 );
-            final Protein jklm = new BasicProtein( "jklm", "varanus", 0 );
-            jklm.addProteinDomain( j );
-            jklm.addProteinDomain( k );
-            jklm.addProteinDomain( l );
-            jklm.addProteinDomain( m );
-            jklm.addProteinDomain( m0 );
-            jklm.addProteinDomain( m1 );
-            jklm.addProteinDomain( m2 );
-            final Protein jklm_s0 = SurfacingUtil.removeOverlappingDomains( 10, false, jklm );
-            if ( jklm.getNumberOfProteinDomains() != 7 ) {
-                return false;
-            }
-            if ( jklm_s0.getNumberOfProteinDomains() != 1 ) {
-                return false;
-            }
-            if ( !jklm_s0.getProteinDomain( 0 ).getDomainId().getId().equals( "l" ) ) {
-                return false;
-            }
-            final Protein jklm_s1 = SurfacingUtil.removeOverlappingDomains( 11, false, jklm );
-            if ( jklm.getNumberOfProteinDomains() != 7 ) {
-                return false;
-            }
-            if ( jklm_s1.getNumberOfProteinDomains() != 7 ) {
-                return false;
-            }
-            final Domain only = new BasicDomain( "only", ( short ) 5, ( short ) 30, ( short ) 4, ( short ) 4, 0.5, 10 );
-            final Protein od = new BasicProtein( "od", "varanus", 0 );
-            od.addProteinDomain( only );
-            final Protein od_s0 = SurfacingUtil.removeOverlappingDomains( 0, false, od );
-            if ( od.getNumberOfProteinDomains() != 1 ) {
-                return false;
-            }
-            if ( od_s0.getNumberOfProteinDomains() != 1 ) {
-                return false;
-            }
-        }
-        catch ( final Exception e ) {
-            e.printStackTrace( System.out );
-            return false;
-        }
-        return true;
-    }
-
     private static boolean testParsimony() {
         try {
             final BinaryStates X = BinaryStates.PRESENT;
@@ -5973,7 +5295,7 @@ public class TestSurfacing {
             gwcd_list.add( two );
             gwcd_list.add( three );
             gwcd_list.add( four );
-            final Map<DomainId, Set<String>> map_same = new HashMap<DomainId, Set<String>>();
+            final Map<String, Set<String>> map_same = new HashMap<String, Set<String>>();
             final HashSet<String> a_s = new HashSet<String>();
             a_s.add( "AAA" );
             final HashSet<String> b_s = new HashSet<String>();
@@ -6160,130 +5482,4 @@ public class TestSurfacing {
         }
         return true;
     }
-
-    private static boolean testProteinId() {
-        try {
-            final ProteinId id1 = new ProteinId( "a" );
-            final ProteinId id2 = new ProteinId( "a" );
-            final ProteinId id3 = new ProteinId( "A" );
-            final ProteinId id4 = new ProteinId( "b" );
-            if ( !id1.equals( id1 ) ) {
-                return false;
-            }
-            if ( id1.getId().equals( "x" ) ) {
-                return false;
-            }
-            if ( id1.getId().equals( null ) ) {
-                return false;
-            }
-            if ( !id1.equals( id2 ) ) {
-                return false;
-            }
-            if ( id1.equals( id3 ) ) {
-                return false;
-            }
-            if ( id1.hashCode() != id1.hashCode() ) {
-                return false;
-            }
-            if ( id1.hashCode() != id2.hashCode() ) {
-                return false;
-            }
-            if ( id1.hashCode() == id3.hashCode() ) {
-                return false;
-            }
-            if ( id1.compareTo( id1 ) != 0 ) {
-                return false;
-            }
-            if ( id1.compareTo( id2 ) != 0 ) {
-                return false;
-            }
-            if ( id1.compareTo( id3 ) != 0 ) {
-                return false;
-            }
-            if ( id1.compareTo( id4 ) >= 0 ) {
-                return false;
-            }
-            if ( id4.compareTo( id1 ) <= 0 ) {
-                return false;
-            }
-            if ( !id4.getId().equals( "b" ) ) {
-                return false;
-            }
-            final ProteinId id5 = new ProteinId( " C " );
-            if ( !id5.getId().equals( "C" ) ) {
-                return false;
-            }
-            if ( id5.equals( id1 ) ) {
-                return false;
-            }
-        }
-        catch ( final Exception e ) {
-            e.printStackTrace( System.out );
-            return false;
-        }
-        return true;
-    }
-
-    private static boolean testSpecies() {
-        try {
-            final Species s1 = new BasicSpecies( "a" );
-            final Species s2 = new BasicSpecies( "a" );
-            final Species s3 = new BasicSpecies( "A" );
-            final Species s4 = new BasicSpecies( "b" );
-            if ( !s1.equals( s1 ) ) {
-                return false;
-            }
-            if ( s1.getSpeciesId().equals( "x" ) ) {
-                return false;
-            }
-            if ( s1.getSpeciesId().equals( null ) ) {
-                return false;
-            }
-            if ( !s1.equals( s2 ) ) {
-                return false;
-            }
-            if ( s1.equals( s3 ) ) {
-                return false;
-            }
-            if ( s1.hashCode() != s1.hashCode() ) {
-                return false;
-            }
-            if ( s1.hashCode() != s2.hashCode() ) {
-                return false;
-            }
-            if ( s1.hashCode() == s3.hashCode() ) {
-                return false;
-            }
-            if ( s1.compareTo( s1 ) != 0 ) {
-                return false;
-            }
-            if ( s1.compareTo( s2 ) != 0 ) {
-                return false;
-            }
-            if ( s1.compareTo( s3 ) != 0 ) {
-                return false;
-            }
-            if ( s1.compareTo( s4 ) >= 0 ) {
-                return false;
-            }
-            if ( s4.compareTo( s1 ) <= 0 ) {
-                return false;
-            }
-            if ( !s4.getSpeciesId().equals( "b" ) ) {
-                return false;
-            }
-            final Species s5 = new BasicSpecies( " C " );
-            if ( !s5.getSpeciesId().equals( "C" ) ) {
-                return false;
-            }
-            if ( s5.equals( s1 ) ) {
-                return false;
-            }
-        }
-        catch ( final Exception e ) {
-            e.printStackTrace( System.out );
-            return false;
-        }
-        return true;
-    }
 }