PaletteComponentHandler { @NotNull public String getGradleCoordinateId(@NotNull String tagName) { if (tagName.startsWith(ANDROID_SUPPORT_V4_PKG)) { return SUPPORT_LIB_ARTIFACT; } else if (tagName.startsWith(ANDROID_SUPPORT_V7_PKG)) { return APPCOMPAT_LIB_ARTIFACT; } else if (tagName.startsWith(ANDROID_SUPPORT_DESIGN_PKG)) { return DESIGN_LIB_ARTIFACT; } else if (tagName.startsWith(ANDROID_MATERIAL_PKG)) { return ANDROIDX_MATERIAL_ARTIFACT; } else if (tagName.startsWith(ANDROID_SUPPORT_LEANBACK_V17_PKG)) { return LEANBACK_V17_ARTIFACT; } else if (tagName.startsWith(GOOGLE_PLAY_SERVICES_ADS_PKG)) { return ADS_ARTIFACT; } else if (tagName.startsWith(GOOGLE_PLAY_SERVICES_MAPS_PKG)) { return MAPS_ARTIFACT; } else if (tagName.startsWith(CONSTRAINT_LAYOUT_PKG)) { return CONSTRAINT_LAYOUT_LIB_ARTIFACT; } else if (tagName.startsWith(ANDROIDX_CONSTRAINT_LAYOUT_PKG)) { return ANDROIDX_CONSTRAINT_LAYOUT_LIB_ARTIFACT; } else if (tagName.startsWith(ANDROIDX_RECYCLER_VIEW_PKG)) { return ANDROIDX_RECYCLER_VIEW_ARTIFACT; } else if (tagName.startsWith(ANDROIDX_CARD_VIEW_PKG)) { return ANDROIDX_CARD_VIEW_ARTIFACT; } else if (tagName.startsWith(ANDROIDX_GRID_LAYOUT_PKG)) { return ANDROIDX_GRID_LAYOUT_ARTIFACT; } else if (tagName.startsWith(ANDROIDX_LEANBACK_PKG)) { return ANDROIDX_LEANBACK_ARTIFACT; } else if (tagName.startsWith(ANDROIDX_CORE_PKG)) { return ANDROIDX_SUPPORT_LIB_ARTIFACT; } else if (tagName.startsWith(ANDROIDX_VIEWPAGER_PKG)) { return ANDROIDX_VIEW_PAGER_LIB_ARTIFACT; } else if (tagName.startsWith(ANDROIDX_APPCOMPAT_PKG)) { return ANDROIDX_APPCOMPAT_LIB_ARTIFACT; } return IN_PLATFORM; }  @NotNull String getTitle(@NotNull String tagName); @NotNull Icon getIcon(@NotNull String tagName); @NotNull String getGradleCoordinateId(@NotNull String tagName); @NotNull @Language("XML") String getXml(@NotNull String tagName, @NotNull XmlType xmlType); double getPreviewScale(@NotNull String tagName); @Language("XML")
  static final String NO_PREVIEW; static final String IN_PLATFORM; }
@Test public void testGetGradleCoordinateId() { PaletteComponentHandler handler = new PaletteComponentHandler() {}; assertThat(handler.getGradleCoordinateId(NESTED_SCROLL_VIEW.oldName())).isEqualTo(SUPPORT_LIB_ARTIFACT); assertThat(handler.getGradleCoordinateId(NESTED_SCROLL_VIEW.newName())).isEqualTo(ANDROIDX_SUPPORT_LIB_ARTIFACT); assertThat(handler.getGradleCoordinateId(CLASS_CONSTRAINT_LAYOUT_BARRIER.oldName())).isEqualTo(CONSTRAINT_LAYOUT_LIB_ARTIFACT); assertThat(handler.getGradleCoordinateId(CLASS_CONSTRAINT_LAYOUT_BARRIER.newName())).isEqualTo(ANDROIDX_CONSTRAINT_LAYOUT_LIB_ARTIFACT); assertThat(handler.getGradleCoordinateId(CLASS_BROWSE_FRAGMENT.oldName())).isEqualTo(LEANBACK_V17_ARTIFACT); assertThat(handler.getGradleCoordinateId(CLASS_BROWSE_FRAGMENT.newName())).isEqualTo(ANDROIDX_LEANBACK_ARTIFACT); assertThat(handler.getGradleCoordinateId(CLASS_FLOATING_ACTION_BUTTON.oldName())).isEqualTo(DESIGN_LIB_ARTIFACT); assertThat(handler.getGradleCoordinateId(CLASS_FLOATING_ACTION_BUTTON.newName())).isEqualTo(ANDROIDX_MATERIAL_ARTIFACT); assertThat(handler.getGradleCoordinateId(RECYCLER_VIEW.oldName())).isEqualTo(APPCOMPAT_LIB_ARTIFACT); assertThat(handler.getGradleCoordinateId(RECYCLER_VIEW.newName())).isEqualTo(ANDROIDX_RECYCLER_VIEW_ARTIFACT); assertThat(handler.getGradleCoordinateId(CARD_VIEW.oldName())).isEqualTo(APPCOMPAT_LIB_ARTIFACT); assertThat(handler.getGradleCoordinateId(CARD_VIEW.newName())).isEqualTo(ANDROIDX_CARD_VIEW_ARTIFACT); assertThat(handler.getGradleCoordinateId(TOOLBAR_V7.oldName())).isEqualTo(APPCOMPAT_LIB_ARTIFACT); assertThat(handler.getGradleCoordinateId(TOOLBAR_V7.newName())).isEqualTo(ANDROIDX_APPCOMPAT_LIB_ARTIFACT); }