Apps not closed after testing

I am testing some android apps using appium. the apps are not closed/killed after testing.
They are still running in the background can you tell me how to completely kill/close them.
My details software details are java-client-5.0.0-BETA8 , java 1.8 , windows 10 and appium version1.6.5
This is the code i am using

public class EarnMafiaTest {
private AndroidDriver driver;
long one_minute_delay = 60000 * 1 ;
long fifteen_seconds_delay = 15000 * 1 ;
AppiumServerJava appiumServerJava;
MobileCapabilities mobileCapabilities;

public void setUp(int port,int deviceId) throws MalformedURLException {
	System.out.println("started setUp()" );
    appiumServerJava = new AppiumServerJava();
    // start appium appiumServer
    appiumServerJava.startServer(port);
    // get mobile capabilities 
    mobileCapabilities = new MobileCapabilities();
    
    // get mobile capabilities 
    mobileCapabilities = new MobileCapabilities();




    // Created object of DesiredCapabilities class.
  //  DesiredCapabilities capabilities = new DesiredCapabilities();
    
    // Set android deviceName desired capability. Set your device name.
    capabilities.setCapability("deviceName", "LC51GY642544");
    
    // Set android VERSION desired capability. Set your mobile device's OS version.
    capabilities.setCapability(CapabilityType.VERSION, "4.4.2");
	
    // Set BROWSER_NAME desired capability. It's Android in our case here.
    capabilities.setCapability(CapabilityType.BROWSER_NAME, "Android");


    // Set android platformName desired capability. It's Android in our case here.
    capabilities.setCapability("platformName", "Android");
    // this willnot delet app data and app registration details
    capabilities.setCapability("noReset", "true");

    // set timeout to 5minutes
    //   capabilities.setCapability("newCommandTimeout", 300);
    // delay 2minutes
    capabilities.setCapability("newCommandTimeout", 315);

    // Set android appPackage desired capability. It is
    // com.android.calculator2 for calculator application.
    // Set your application's appPackage if you are using any other app.
    //  capabilities.setCapability("appPackage", "com.google.android.calculator");
    capabilities.setCapability("appPackage", "com.earn.free.cash");

    // Set android appActivity desired capability. It is
    // com.android.calculator2.Calculator for calculator application.
    // Set your application's appPackage if you are using any other app.
    //    capabilities.setCapability("appActivity", "com.google.android.calculator.Calculator");
    capabilities.setCapability("appActivity", "com.earn.free.cash.activities.SplashActivity");


    // Created object of RemoteWebDriver will all set capabilities.
    // Set appium server address and port number in URL string.
    // It will launch calculator app in android device.
    //capabilities.setCapability("browserName", "Chrome");

    String url ="http://127.0.0.1:"+port+"/wd/hub";

    driver = new AndroidDriver(new URL(url), capabilities) ;


    driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);


}

// started testing app
public void testApp() {
	System.out.println("started testApp()" );


    try {
        Thread.sleep(5000);
        // click on magic box icon
        
        browseApp();
        

        Thread.sleep(2000);
       // driver.findElement(By.id("com.payumoney:id/logo")).click();
        // click on videos link at the bottom
       //  driver.findElement(By.id("com.payumoney:id/title_vungle")).click();
        // scroll to videos image
        

      
    }catch (Exception e) {
        e.printStackTrace();
    }

}
// this method will browse the app for 5 minutes
public void browseApp() {
    try {
    	
    	
        
        // click on magic box icon
        
      //  clickSpinTheWheel();
        

        Thread.sleep(2000);
       // driver.findElement(By.id("com.payumoney:id/logo")).click();
        // click on videos link at the bottom
       //  driver.findElement(By.id("com.payumoney:id/title_vungle")).click();
        // scroll to videos image
        

      
    }catch (Exception e) {
        e.printStackTrace();
    }

	
}



public void end() {
	System.out.println("started end()" );
	
	appiumServerJava.stopServer();
	
    driver.quit();
	
    System.out.println("driver.quit()" );
    try {
    	
        Thread.sleep(10000);
    }catch(Exception e) {
        e.printStackTrace();
    }

  //  appiumServerJava.stopServer();
    System.out.println("stopServer()" );

}
public static void main(String args[]) {
	System.out.println("in public static void mian" );
	
	int deviceId = 0;
	
	if(args[0].isEmpty()) {
		
	} else {
		System.out.println("args[0]" + args[0] );
		deviceId = Integer.parseInt(args[0]);
		//port = 4723;
	}
	
	System.out.println("deviceId" + deviceId );

	
	
	try {
		EarnMafiaTest earnMafiaTest = new EarnMafiaTest();
		FreePort freePort= new FreePort();
		int port = freePort.findFreePort();
		port = freePort.findFreePort();
		port = freePort.findFreePort();

		earnMafiaTest.setUp(port,deviceId);
		earnMafiaTest.testApp();
		earnMafiaTest.end();
	} catch(Exception e) {
		e.printStackTrace();
	}
}

}

Why do you want to force stop the apps after the test ends?

If you really want and since you are using android, you can execute the command:

adb shell am force-stop Ā«app_packageĀ»