### Question:
CacheEntryLUWrapper implements Comparable<CacheEntryLUWrapper> { @Override public int compareTo(CacheEntryLUWrapper o) { return Utilities.sameInstance(this, o) || myLastUsedTime == o.myLastUsedTime ? 0 : myLastUsedTime < o.myLastUsedTime ? -1 : 1; } CacheEntryLUWrapper(CacheEntry pCacheEntry); @Override int compareTo(CacheEntryLUWrapper o); @Override boolean equals(Object obj); CacheEntry getEntry(); @Override int hashCode();  }### Answer:
@Test public void testCompareTo() { assertEquals(0, myTestObject.compareTo(myTestObject)); DynamicEnumerationRegistry registry = createStrictMock(DynamicEnumerationRegistry.class); DataElement element = createStrictMock(DataElement.class); VisualizationState state = new VisualizationState(false); expect(element.getVisualizationState()).andReturn(state); TimeSpan span = TimeSpan.get(0, 1); expect(element.getTimeSpan()).andReturn(span).anyTimes(); DataTypeInfo mockDataType = createStrictMock(DataTypeInfo.class); expect(element.getDataTypeInfo()).andReturn(mockDataType); expect(mockDataType.getTypeKey()).andReturn("TYPE_KEY").anyTimes(); MetaDataProvider mockMetaDataProvider = createStrictMock(MetaDataProvider.class); expect(element.getMetaData()).andReturn(mockMetaDataProvider); expect(element.getId()).andReturn(Long.MAX_VALUE); replay(element, mockDataType); boolean useDynamicClasses = false; try { Thread.sleep(25); } catch (InterruptedException e) { } CacheEntry otherEntry = new CacheEntry(registry, element, useDynamicClasses); CacheEntryLUWrapper otherObject = new CacheEntryLUWrapper(myTestEntry); assertEquals(0, myTestObject.compareTo(otherObject)); CacheEntryLUWrapper yetAnotherObject = new CacheEntryLUWrapper(otherEntry); assertEquals(-1, myTestObject.compareTo(yetAnotherObject)); }