-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from ismail-elshafeiy/Waits-functions
Add java collections examples
- Loading branch information
Showing
226 changed files
with
2,619 additions
and
280 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/test/java/api/graphQL/GraphQlTest.java → ...java/apiPractice/graphQL/GraphQlTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...a/api/rest/TAU/dataentities/Location.java → ...ctice/rest/TAU/dataentities/Location.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...java/api/rest/TAU/dataentities/Place.java → ...Practice/rest/TAU/dataentities/Place.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...va/api/rest/TestAPIs_Booking/ApiTest.java → ...actice/rest/TestAPIs_Booking/ApiTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t/java/api/rest/dataentities/Address.java → ...piPractice/rest/dataentities/Address.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package api.rest.dataentities; | ||
package apiPractice.rest.dataentities; | ||
|
||
public class Address { | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
src/test/java/api/rest/dataentities/Car.java → ...va/apiPractice/rest/dataentities/Car.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package api.rest.dataentities; | ||
package apiPractice.rest.dataentities; | ||
|
||
public class Car { | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...est/java/api/rest/dataentities/Photo.java → .../apiPractice/rest/dataentities/Photo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package api.rest.dataentities; | ||
package apiPractice.rest.dataentities; | ||
|
||
public class Photo { | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
.../api/rest/restAssured/DataDrivenDemo.java → ...tice/rest/restAssured/DataDrivenDemo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../rest/restAssured/OptimizingCodeDemo.java → .../rest/restAssured/OptimizingCodeDemo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...api/rest/restAssured/RestAssuredDemo.java → ...ice/rest/restAssured/RestAssuredDemo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...stAssured/RestAssuredPostRequestDemo.java → ...stAssured/RestAssuredPostRequestDemo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package api.rest.restAssured; | ||
package apiPractice.rest.restAssured; | ||
|
||
import org.testng.annotations.Test; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...st/run_script_dataDriven/data_driven.java → ...st/run_script_dataDriven/data_driven.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rest/run_script_dataDriven/read_data.java → ...rest/run_script_dataDriven/read_data.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...pi/rest/run_script_jsn/TestCase_json.java → ...ce/rest/run_script_jsn/TestCase_json.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...saveToFile/Save_API_Response_To_File.java → ...saveToFile/Save_API_Response_To_File.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../java/api/restAssured/BookingTestApi.java → ...iPractice/restAssured/BookingTestApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...est/java/java/arrays/A_LotteryTicket.java → .../javaPractice/arrays/A_LotteryTicket.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.arrays; | ||
package javaPractice.arrays; | ||
|
||
import java.util.Arrays; | ||
import java.util.Random; | ||
|
2 changes: 1 addition & 1 deletion
2
...est/java/java/coursesJava/ArraysDemo.java → .../java/javaPractice/arrays/ArraysDemo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/test/java/java/arrays/B_Grades.java → ...st/java/javaPractice/arrays/B_Grades.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.arrays; | ||
package javaPractice.arrays; | ||
|
||
import java.util.Scanner; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...test/java/java/arrays/C_DayOfTheWeek.java → ...a/javaPractice/arrays/C_DayOfTheWeek.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.arrays; | ||
package javaPractice.arrays; | ||
|
||
import java.util.Scanner; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
.../java/java/coursesJava/DemoArrayList.java → ...va/javaPractice/arrays/DemoArrayList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.coursesJava; | ||
package javaPractice.arrays; | ||
|
||
import java.util.ArrayList; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...java/java/coursesJava/DemoArrayList2.java → ...a/javaPractice/arrays/DemoArrayList2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.coursesJava; | ||
package javaPractice.arrays; | ||
|
||
import java.util.ArrayList; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...ava/coursesJava/DemoArrayListConcept.java → ...Practice/arrays/DemoArrayListConcept.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.coursesJava; | ||
package javaPractice.arrays; | ||
|
||
import java.util.ArrayList; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...st/java/java/coursesJava/StaticArray.java → ...java/javaPractice/arrays/StaticArray.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.coursesJava; | ||
package javaPractice.arrays; | ||
|
||
public class StaticArray { | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
src/test/java/java/arrays/test.java → src/test/java/javaPractice/arrays/test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.arrays; | ||
package javaPractice.arrays; | ||
|
||
public class test { | ||
public static void main(String[] args) { | ||
|
2 changes: 1 addition & 1 deletion
2
...java/java/classesAndObjects/A_Method.java → ...aPractice/classesAndObjects/A_Method.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.classesAndObjects; | ||
package javaPractice.classesAndObjects; | ||
|
||
import java.util.Scanner; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...a/java/classesAndObjects/A_Rectangle.java → ...actice/classesAndObjects/A_Rectangle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...assesAndObjects/B_HomeAreaCalculator.java → ...assesAndObjects/B_HomeAreaCalculator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.classesAndObjects; | ||
package javaPractice.classesAndObjects; | ||
|
||
import java.util.Scanner; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...va/java/classesAndObjects/B_Variable.java → ...ractice/classesAndObjects/B_Variable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.classesAndObjects; | ||
package javaPractice.classesAndObjects; | ||
|
||
import java.util.Scanner; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...sAndObjects/C_HomeAreaCalculatorRedo.java → ...sAndObjects/C_HomeAreaCalculatorRedo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.classesAndObjects; | ||
package javaPractice.classesAndObjects; | ||
|
||
import java.util.Scanner; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...va/java/classesAndObjects/C_Operator.java → ...ractice/classesAndObjects/C_Operator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.classesAndObjects; | ||
package javaPractice.classesAndObjects; | ||
|
||
|
||
import java.util.Scanner; | ||
|
2 changes: 1 addition & 1 deletion
2
.../classesAndObjects/ExceptionHandling.java → .../classesAndObjects/ExceptionHandling.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...classesAndObjects/GrossPayCalculator.java → ...classesAndObjects/GrossPayCalculator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.classesAndObjects; | ||
package javaPractice.classesAndObjects; | ||
|
||
import java.util.Scanner; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...ava/java/collections/CollectionsDemo.java → ...Practice/collections/CollectionsDemo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.collections; | ||
package javaPractice.collections; | ||
|
||
import java.util.*; | ||
|
||
|
23 changes: 23 additions & 0 deletions
23
src/test/java/javaPractice/collections/Comparable/ComparableExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package javaPractice.collections.Comparable; | ||
|
||
import java.time.LocalDate; | ||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class ComparableExample { | ||
public static void main(String[] args) { | ||
List<Employee> employees = new ArrayList<>(); | ||
|
||
employees.add(new Employee(1010, "Rajeev", 100000.00, LocalDate.of(2010, 7, 10))); | ||
employees.add(new Employee(1004, "Chris", 95000.50, LocalDate.of(2017, 3, 19))); | ||
employees.add(new Employee(1015, "David", 134000.00, LocalDate.of(2017, 9, 28))); | ||
|
||
System.out.println("Employees (Before Sorting) : " + employees); | ||
|
||
// This will use the `compareTo()` method of the `Employee` class to compare two employees and sort them. | ||
Collections.sort(employees); | ||
|
||
System.out.println("\nEmployees (After Sorting) : " + employees); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/test/java/javaPractice/collections/Comparable/ComparatorExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package javaPractice.collections.Comparable; | ||
|
||
import java.time.LocalDate; | ||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.Comparator; | ||
import java.util.List; | ||
|
||
public class ComparatorExample { | ||
public static void main(String[] args) { | ||
List<Employee> employees = new ArrayList<>(); | ||
|
||
employees.add(new Employee(1010, "Rajeev", 100000.00, LocalDate.of(2010, 7, 10))); | ||
employees.add(new Employee(1004, "Chris", 95000.50, LocalDate.of(2017, 3, 19))); | ||
employees.add(new Employee(1015, "David", 134000.00, LocalDate.of(2017, 9, 28))); | ||
employees.add(new Employee(1009, "Steve", 100000.00, LocalDate.of(2016, 5, 18))); | ||
|
||
System.out.println("Employees : " + employees); | ||
|
||
// Sort employees by Name | ||
Collections.sort(employees, Comparator.comparing(Employee::getName)); | ||
System.out.println("\nEmployees (Sorted by Name) : " + employees); | ||
|
||
// Sort employees by Salary | ||
Collections.sort(employees, Comparator.comparingDouble(Employee::getSalary)); | ||
System.out.println("\nEmployees (Sorted by Salary) : " + employees); | ||
|
||
// Sort employees by JoiningDate | ||
Collections.sort(employees, Comparator.comparing(Employee::getJoiningDate)); | ||
System.out.println("\nEmployees (Sorted by JoiningDate) : " + employees); | ||
|
||
// Sort employees by Name in descending order | ||
Collections.sort(employees, Comparator.comparing(Employee::getName).reversed()); | ||
System.out.println("\nEmployees (Sorted by Name in descending order) : " + employees); | ||
|
||
// Chaining multiple Comparators | ||
// Sort by Salary. If Salary is same then sort by Name | ||
Collections.sort(employees, Comparator.comparingDouble(Employee::getSalary).thenComparing(Employee::getName)); | ||
System.out.println("\nEmployees (Sorted by Salary and Name) : " + employees); | ||
} | ||
} |
Oops, something went wrong.