All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bichromate.lambdhas.sortLamdbhas Maven / Gradle / Ivy

Go to download

Java, Selenium, Appium, Winium, Extend, and TestNG automated testing framework. Bichromate integrates the best of these frameworks and takes automation to the next level. With Bichromate there is one function call that builds any type of Web,IOS Mobile, Android, and Windows App driver on any platform (Windows, Mac, Linux). From Local web drivers, to SauceLabs, Browserstack, and Selenium grid. Build data driven tests is never easier. Bichromate also gives you built in Factories that, access DBs, Video Capture, FTP, POM Generation, Hilite element.

There is a newer version: 3.13
Show newest version
package bichromate.lambdhas;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

// http://winterbe.com/posts/2014/03/16/java-8-tutorial/


public class sortLamdbhas {

	List names = Arrays.asList("peter", "anna", "mike", "xenia");
	
	
	
	private void selfTest(){
		
		for(int x = 0; x < names.size(); x++){
			
			System.out.println(names.get(x).toString());
		}
		
		
		//
		// Old way
		//
		/*
		Collections.sort(names, new Comparator() {
			
		    @Override
		    public int compare(String a, String b) {
		        return b.compareTo(a);
		    }
		});
		*/
		//
		// Using Lambdahs
		//
		//Collections.sort(names, (String a, String b) -> {
		//    return b.compareTo(a);
		//});
		//
		// Refine Lambdahs
		//
		Collections.sort(names, (a, b) -> b.compareTo(a));
		
		System.out.println("============== AFTER SORT==================");
		for(int x = 0; x < names.size(); x++){
			
			System.out.println(names.get(x).toString());
		}
	}
	
	
	
	//
	// Inner class for testing on the command line
	//
	 public static class Test
	 {
	 	public static void main(final String[] args){
	 		
	 		sortLamdbhas testLamdhas = new sortLamdbhas();
	 		if(null != testLamdhas){
	 			testLamdhas.selfTest();
	 		}
	 		
	 	}
	 }
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy