How to close current browser tab?

How to close current browser tab?

JavaScript.getCurrent().execute("window.close();");
UI.getCurrent().removeWindow(window);
window.close();

This code isn’t working.