class ConnectionServiceImpl implements ConnectionService {

    private boolean isConnected = false;

    @Override
    public void openConnection() {
        isConnected = true;
        System.out.println("connection opened.");
    }

    @Override
    public void closeConnection() {<FILL_FUNCTION_BODY>}

    @Override
    public boolean isConnected() {
        return isConnected;
    }
}

        if (isConnected) {
            isConnected = false;
            System.out.println("connection closed.");
        }
    
<no_super_class>