### Question:
KarafCapability implements ICapability, Comparable<ICapability> { @Override public int compareTo( ICapability o ) { return this.getId().compareTo( o.getId() ); } KarafCapability( FeaturesService featuresService, Feature feature, KarafCapabilityProvider manager ); @Override String getId(); @Override String getDescription( Locale locale ); @Override boolean isInstalled(); @Override Future<Boolean> install(); @Override Future<Boolean> uninstall(); @Override URI getSourceUri(); @Override int compareTo( ICapability o );  }### Answer:
@Test public void testCompareTo() throws Exception { karafCapability = new KarafCapability( featuresService, feature, karafCapabilityProvider ); ICapability capability = mock( ICapability.class ); when( capability.getId() ).thenReturn( TEST_CAPABILITY_NAME ); int isComparable = karafCapability.compareTo( capability ); assert( isComparable == 0 ); }