TooltipLabel extends JBLabel { @Override public void setText(String text) { } TooltipLabel(); @Override void setText(String text); void setScope(@Nullable Container scope);  }
@Test public void tooltipLabelCantSetTextDirectly() throws Exception { String text = myTooltipLabel.getText(); myTooltipLabel.setText("IGNORED TEXT"); assertThat(myTooltipLabel.getText()).isEqualTo(text); }