### Question:
PluginDesc implements Comparable<PluginDesc<T>> { @Override public int hashCode() { return Objects.hash(klass, version, type); } PluginDesc(Class<? extends T> klass, String version, ClassLoader loader); @Override String toString(); Class<? extends T> pluginClass(); @JsonProperty("class") String className(); @JsonProperty("version") String version(); PluginType type(); @JsonProperty("type") String typeName(); @JsonProperty("location") String location(); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(PluginDesc other);  }### Answer:
@Test public void testPluginDescEquality() throws Exception { PluginDesc<Connector> connectorDescPluginPath = new PluginDesc<>( Connector.class, snaphotVersion, pluginLoader ); PluginDesc<Connector> connectorDescClasspath = new PluginDesc<>( Connector.class, snaphotVersion, systemLoader ); assertEquals(connectorDescPluginPath, connectorDescClasspath); assertEquals(connectorDescPluginPath.hashCode(), connectorDescClasspath.hashCode()); PluginDesc<Converter> converterDescPluginPath = new PluginDesc<>( Converter.class, noVersion, pluginLoader ); PluginDesc<Converter> converterDescClasspath = new PluginDesc<>( Converter.class, noVersion, systemLoader ); assertEquals(converterDescPluginPath, converterDescClasspath); assertEquals(converterDescPluginPath.hashCode(), converterDescClasspath.hashCode()); PluginDesc<Transformation> transformDescPluginPath = new PluginDesc<>( Transformation.class, null, pluginLoader ); PluginDesc<Transformation> transformDescClasspath = new PluginDesc<>( Transformation.class, noVersion, pluginLoader ); assertNotEquals(transformDescPluginPath, transformDescClasspath); }
@Test public void testPluginDescEquality() { PluginDesc<Connector> connectorDescPluginPath = new PluginDesc<>( Connector.class, snaphotVersion, pluginLoader ); PluginDesc<Connector> connectorDescClasspath = new PluginDesc<>( Connector.class, snaphotVersion, systemLoader ); assertEquals(connectorDescPluginPath, connectorDescClasspath); assertEquals(connectorDescPluginPath.hashCode(), connectorDescClasspath.hashCode()); PluginDesc<Converter> converterDescPluginPath = new PluginDesc<>( Converter.class, noVersion, pluginLoader ); PluginDesc<Converter> converterDescClasspath = new PluginDesc<>( Converter.class, noVersion, systemLoader ); assertEquals(converterDescPluginPath, converterDescClasspath); assertEquals(converterDescPluginPath.hashCode(), converterDescClasspath.hashCode()); PluginDesc<Transformation> transformDescPluginPath = new PluginDesc<>( Transformation.class, null, pluginLoader ); PluginDesc<Transformation> transformDescClasspath = new PluginDesc<>( Transformation.class, noVersion, pluginLoader ); assertNotEquals(transformDescPluginPath, transformDescClasspath); }