### Question:
DefaultToolchain implements Toolchain, ToolchainPrivate { @Override public boolean equals( Object obj ) { if ( obj == null ) { return false; } if ( this == obj ) { return true; } if ( !( obj instanceof DefaultToolchain ) ) { return false; } DefaultToolchain other = (DefaultToolchain) obj; if ( !Objects.equals( type, other.type ) ) { return false; } Properties thisProvides = this.getModel().getProvides(); Properties otherProvides = other.getModel().getProvides(); return Objects.equals( thisProvides, otherProvides ); } protected  DefaultToolchain( ToolchainModel model, Logger logger ); protected  DefaultToolchain( ToolchainModel model, String type, Logger logger ); @Override final String getType(); @Override final ToolchainModel getModel(); final void addProvideToken( String type, RequirementMatcher matcher ); @Override boolean matchesRequirements( Map<String, String> requirements ); @Override boolean equals( Object obj ); @Override int hashCode(); @Override String toString(); static final String KEY_TYPE; }### Answer:
@Test public void testEquals() throws Exception { try ( InputStream jdksIS = ToolchainModel.class.getResourceAsStream( "toolchains-jdks.xml" ); InputStream jdksExtraIS = ToolchainModel.class.getResourceAsStream( "toolchains-jdks-extra.xml" ) ) { PersistedToolchains jdks = reader.read( jdksIS ); PersistedToolchains jdksExtra = reader.read( jdksExtraIS ); DefaultToolchain tc1 = new DefaultJavaToolChain( jdks.getToolchains().get( 0 ), null ); DefaultToolchain tc2 = new DefaultJavaToolChain( jdksExtra.getToolchains().get( 0 ), null ); assertEquals( tc1, tc1 ); assertNotEquals( tc1, tc2 ); assertNotEquals( tc2, tc1 ); assertEquals( tc2, tc2 ); } }