How to perform proper if condition

im using this function below but actually appium still perform both conditions for example if the element is displayed it will perform first part in the if() and then the part of catch ()

and if the element is not displayed it will perform only the part in catch

but actually this not what i want, i want if the element is displayed do this and end the test

and if the element is not displayed do this and end the test if(condition )
{ // do this
} else
{ // do this}
public void Verify_user_can_add_and_remove_song() {;;;
try {
if (element.isDisplayed()) {
System.out.println(“song is displayed in the playlist”);;
//performing long press (press and hold)
TouchAction action = new TouchAction(driver);
Assert.assertNotEquals(element.isDisplayed(), false);

    } catch(NoSuchElementException e){
                System.out.println("element is not displayed in the playlist");
                //conditional wait until presence of an element
                new WebDriverWait(driver, 15).until(ExpectedConditions.presenceOfElementLocated(""))).click();
                Assert.assertEquals(elemnet.getText(), " text (Original Mix)");