}
@Test
public void testCompareTo() {
Factor equalFactor = EMFfitModelFactory.eINSTANCE.createFactor();
equalFactor.setName("foo");
HashMap<String, String> equalFactorContent = new HashMap<String, String>();
equalFactorContent.put("name", "foo");
ContentProviderResultItem equalItem = new ContentProviderResultItem(equalFactor.getIdentifier(), equalFactor,"P1.2 " + equalFactor.getName(), null, equalFactorContent, project);
HashMap<String, String> belowFactorContent = new HashMap<String, String>();
belowFactorContent.put("name", "foa");
Factor belowFactor = EMFfitModelFactory.eINSTANCE.createFactor();
belowFactor.setName("foa");
ContentProviderResultItem belowItem = new ContentProviderResultItem(belowFactor.getIdentifier(), belowFactor, "P1.1 " + belowFactor.getName(), null, belowFactorContent, project);
HashMap<String, String> aboveFactorContent = new HashMap<String, String>();
aboveFactorContent.put("name", "foz");
Factor aboveFactor = EMFfitModelFactory.eINSTANCE.createFactor();
aboveFactor.setName("foz");
ContentProviderResultItem aboveItem = new ContentProviderResultItem(aboveFactor.getIdentifier(), aboveFactor, "P1.3 " + aboveFactor.getName(), null, aboveFactorContent, project);
assertTrue(item.compareTo(aboveItem) < 0);
assertEquals(0, item.compareTo(equalItem));
assertTrue(item.compareTo(belowItem) > 0);
//test with null values
Factor nullFactor = EMFfitModelFactory.eINSTANCE.createFactor();
ContentProviderResultItem nullItem = new ContentProviderResultItem(nullFactor.getIdentifier(), nullFactor, nullFactor.getName(), null, null, null);
assertTrue(item.compareTo(nullItem) > 0);
assertTrue(nullItem.compareTo(item) < 0);