public void testCanReplaceWithHigherPriority() {
// this test actually depends on the keyset implementation of the corresponding cache map.
final DefaultConverterLookup lookup = new DefaultConverterLookup();
Converter currentConverter = new SingleValueConverterWrapper(new StringConverter());
lookup.registerConverter(new BitSetConverter(), XStream.PRIORITY_VERY_HIGH);
lookup.registerConverter(currentConverter, -100);
lookup.lookupConverterForType(String.class);
lookup.lookupConverterForType(BitSet.class);
assertEquals(lookup.lookupConverterForType(String.class), currentConverter);
Converter newConverter = new SingleValueConverterWrapper(new StringConverter());
lookup.registerConverter(newConverter, 100);
assertEquals(lookup.lookupConverterForType(String.class), newConverter);
}