Source:
<code>public void testPalettes() { SWTWorkbenchBot bot = new SWTWorkbenchBot(); resetTimeRange(bot); TimeGraphViewStub view = getView(); Rectangle bounds = fBounds; IPaletteProvider paletteBlue = SequentialPaletteProvider.create(new RGBAColor(0x23, 0x67, 0xf3, 0xff), 5); UIThreadRunnable.syncExec(() -> view.setPresentationProvider(new PalettedPresentationProvider() { @Override <START> public String getPreferenceKey() { <END> return "Blue palette"; } @Override public IPaletteProvider getPalette() { return paletteBlue; } })); List<RGB> rgbs = Lists.transform(paletteBlue.get(), a->RGBAUtil.fromInt(a.toInt()).rgb); fViewBot.bot().waitUntil(new PaletteIsPresent(rgbs, bounds)); IPaletteProvider paletteGreen = SequentialPaletteProvider.create(new RGBAColor(0x23, 0xf3, 0x67, 0xff), 5); UIThreadRunnable.syncExec(() -> view.setPresentationProvider(new PalettedPresentationProvider() { @Override public String getPreferenceKey() { return "Green palette"; } @Override public IPaletteProvider getPalette() { return paletteGreen; } })); rgbs = Lists.transform(paletteGreen.get(), a->RGBAUtil.fromInt(a.toInt()).rgb); fViewBot.bot().waitUntil(new PaletteIsPresent(rgbs, bounds)); IPaletteProvider rotating = new QualitativePaletteProvider.Builder().setAttenuation(0.5f).setBrightness(1.0f).setNbColors(4).build(); UIThreadRunnable.syncExec(() -> view.setPresentationProvider(new PalettedPresentationProvider() { @Override public String getPreferenceKey() { return "Rotating Palette"; } @Override public IPaletteProvider getPalette() { return rotating; } })); rgbs = Lists.transform(rotating.get(), a->RGBAUtil.fromInt(a.toInt()).rgb); fViewBot.bot().waitUntil(new PaletteIsPresent(rgbs, bounds)); }</code><technical_language>getPreferenceKey() overrides necessary</technical_language>

Target:
public void testPalettes() { SWTWorkbenchBot bot = new SWTWorkbenchBot(); resetTimeRange(bot); TimeGraphViewStub view = getView(); Rectangle bounds = fBounds; IPaletteProvider paletteBlue = SequentialPaletteProvider.create(new RGBAColor(0x23, 0x67, 0xf3, 0xff), 5); UIThreadRunnable.syncExec(() -> view.setPresentationProvider(new PalettedPresentationProvider() { @Override public IPaletteProvider getPalette() { return paletteBlue; } })); List<RGB> rgbs = Lists.transform(paletteBlue.get(), a->RGBAUtil.fromInt(a.toInt()).rgb); fViewBot.bot().waitUntil(new PaletteIsPresent(rgbs, bounds)); IPaletteProvider paletteGreen = SequentialPaletteProvider.create(new RGBAColor(0x23, 0xf3, 0x67, 0xff), 5); UIThreadRunnable.syncExec(() -> view.setPresentationProvider(new PalettedPresentationProvider() { @Override public IPaletteProvider getPalette() { return paletteGreen; } })); rgbs = Lists.transform(paletteGreen.get(), a->RGBAUtil.fromInt(a.toInt()).rgb); fViewBot.bot().waitUntil(new PaletteIsPresent(rgbs, bounds)); IPaletteProvider rotating = new QualitativePaletteProvider.Builder().setAttenuation(0.5f).setBrightness(1.0f).setNbColors(4).build(); UIThreadRunnable.syncExec(() -> view.setPresentationProvider(new PalettedPresentationProvider() { @Override public IPaletteProvider getPalette() { return rotating; } })); rgbs = Lists.transform(rotating.get(), a->RGBAUtil.fromInt(a.toInt()).rgb); fViewBot.bot().waitUntil(new PaletteIsPresent(rgbs, bounds)); }