### Question:
PluginDesc implements Comparable<PluginDesc<T>> { @JsonProperty("location") public String location() { return location; } 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 testRegularPluginDesc() throws Exception { PluginDesc<Connector> connectorDesc = new PluginDesc<>( Connector.class, regularVersion, pluginLoader ); assertPluginDesc(connectorDesc, Connector.class, regularVersion, pluginLoader.location()); PluginDesc<Converter> converterDesc = new PluginDesc<>( Converter.class, snaphotVersion, pluginLoader ); assertPluginDesc(converterDesc, Converter.class, snaphotVersion, pluginLoader.location()); PluginDesc<Transformation> transformDesc = new PluginDesc<>( Transformation.class, noVersion, pluginLoader ); assertPluginDesc(transformDesc, Transformation.class, noVersion, pluginLoader.location()); }
@Test public void testPluginDescWithNullVersion() throws Exception { String nullVersion = "null"; PluginDesc<SourceConnector> connectorDesc = new PluginDesc<>( SourceConnector.class, null, pluginLoader ); assertPluginDesc( connectorDesc, SourceConnector.class, nullVersion, pluginLoader.location() ); String location = "classpath"; PluginDesc<Converter> converterDesc = new PluginDesc<>( Converter.class, null, systemLoader ); assertPluginDesc(converterDesc, Converter.class, nullVersion, location); }
@Test public void testRegularPluginDesc() { PluginDesc<Connector> connectorDesc = new PluginDesc<>( Connector.class, regularVersion, pluginLoader ); assertPluginDesc(connectorDesc, Connector.class, regularVersion, pluginLoader.location()); PluginDesc<Converter> converterDesc = new PluginDesc<>( Converter.class, snaphotVersion, pluginLoader ); assertPluginDesc(converterDesc, Converter.class, snaphotVersion, pluginLoader.location()); PluginDesc<Transformation> transformDesc = new PluginDesc<>( Transformation.class, noVersion, pluginLoader ); assertPluginDesc(transformDesc, Transformation.class, noVersion, pluginLoader.location()); }
@Test public void testPluginDescWithNullVersion() { String nullVersion = "null"; PluginDesc<SourceConnector> connectorDesc = new PluginDesc<>( SourceConnector.class, null, pluginLoader ); assertPluginDesc( connectorDesc, SourceConnector.class, nullVersion, pluginLoader.location() ); String location = "classpath"; PluginDesc<Converter> converterDesc = new PluginDesc<>( Converter.class, null, systemLoader ); assertPluginDesc(converterDesc, Converter.class, nullVersion, location); }