import java.util.ArrayList;
import java.util.Comparator;

public class Main {

  public static void main(String[] args) {
   
    // Creating 2 arraylists
    ArrayList<String> Tortoise = new ArrayList<String>();
    ArrayList<String> AquaticTurtle = new ArrayList<String>();

    // Adding without index
    Tortoise.add("Russian Tortoise");
    AquaticTurtle.add("Green Sea Turtle");
    System.out.println("List 1 add() without index:" + "\n" + Tortoise + "\n");

    // list 1 adding with index
    Tortoise.add(0, "Leopard Tortoise");
    Tortoise.add(2, "Marginated Tortoise");
    System.out.println("List 1 add() Leopard Tort at index 0, and Marginated Tort at index 2:" + "\n" + Tortoise + "\n");

    // size()
    System.out.println("Size of list 1:" + "\n" + Tortoise.size() + "\n");

    // Adding list 2 to list 1 using addAll()
    AquaticTurtle.add("Painted Turtle");
    AquaticTurtle.add("Loggerhead Sea Turtle");
    AquaticTurtle.add("Snapping Turtle");

    Tortoise.addAll(AquaticTurtle);
    System.out.println("addAll() adding without index:" + "\n" + Tortoise + "\n");


    // Adding list 2 to list 1 with index
    Tortoise.clear();
    Tortoise.add("Russian Tortoise");
    Tortoise.add("Leopard Tortoise");
    Tortoise.add(0, "Greek Tortoise");
    Tortoise.add(2, "Marginated Tortoise");

    Tortoise.addAll(2, AquaticTurtle);
    System.out.println("addAll() adding at index 2:" + "\n" + Tortoise + "\n");

    // remove(int) index
    Tortoise.remove(6);
    System.out.println("remove() at index 6:" + "\n" + Tortoise + "\n");

    // remove(element)
    Tortoise.remove("Leopard Tortoise");
    System.out.println("remove() Leopard Tort:" + "\n" + Tortoise + "\n");

    // get(index)
    System.out.println("Get element at index 2:" + "\n" + Tortoise.get(2) + "\n");

    // set(index)
    System.out.print("Set element at index 2:" + "\n" + "Before: ");
    System.out.println(Tortoise);
    Tortoise.set(2, "Egyptian Tortoise");
    System.out.println("After: " + Tortoise + "\n");

    // indexOf(element)
    System.out.println("indexOf Russian Tort:" + "\n" + Tortoise.indexOf("Russian Tortoise") + "\n");
    Tortoise.add("Russian Tortoise"); //temp for next method

    // lastIndexOf(element)
    System.out.println("Last index of Russian Tort: " + Tortoise.lastIndexOf("Russian Tortoise") + "\n" + Tortoise + "\n");

    // equals(element)
    System.out.println(" Equals Russian Tort: " + Tortoise.equals("Russian Tortoise") + "\n");

    // hascode()
    System.out.println("Hash Code: " + Tortoise.hashCode() + "\n");

    // isEmpty()
    System.out.println("Is the arraylist empty: "  + Tortoise.isEmpty() + "\n");

    // contains(element)
    System.out.println("Does arraylist contain 'Russian Tortoise': "  + Tortoise.contains("Russian Tortoise") + "\n");

    // containsAll(collection)

    System.out.println("Does arraylist contain Aquatic Turtle collection?: "  + "\n" + "Aquatic Turtle collection: " + AquaticTurtle + "\n");
    System.out.println("Tortoise: " + Tortoise + "\n");
    System.out.println(Tortoise.containsAll(AquaticTurtle) + "\n");
    
    Tortoise.add("Green Sea Turtle"); // Adding missing element

    System.out.println("Does arraylist contain Aquatic Turtle collection?: "  + "\n" + "New Aquatic Turtle collection: " + AquaticTurtle + "\n");
    System.out.println("Tortoise: " + Tortoise + "\n");
    System.out.println(Tortoise.containsAll(AquaticTurtle) + "\n");

    // sort(comparator)
    System.out.println("Unsorted: " + Tortoise);

    Tortoise.sort(Comparator.naturalOrder());
    System.out.println("Sorted using natural alphabetical order comparator: " + Tortoise + "\n");


    // clear()
    Tortoise.clear();
    AquaticTurtle.clear();
    System.out.println("Cleared list1:" + "\n" + Tortoise);
    System.out.println("Cleared list2:" + "\n" + AquaticTurtle);
    

  }

}

Main.main(null);
List 1 add() without index:
[Russian Tortoise]

List 1 add() Leopard Tort at index 0, and Marginated Tort at index 2:
[Leopard Tortoise, Russian Tortoise, Marginated Tortoise]

Size of list 1:
3

addAll() adding without index:
[Leopard Tortoise, Russian Tortoise, Marginated Tortoise, Green Sea Turtle, Painted Turtle, Loggerhead Sea Turtle, Snapping Turtle]

addAll() adding at index 2:
[Greek Tortoise, Russian Tortoise, Green Sea Turtle, Painted Turtle, Loggerhead Sea Turtle, Snapping Turtle, Marginated Tortoise, Leopard Tortoise]

remove() at index 6:
[Greek Tortoise, Russian Tortoise, Green Sea Turtle, Painted Turtle, Loggerhead Sea Turtle, Snapping Turtle, Leopard Tortoise]

remove() Leopard Tort:
[Greek Tortoise, Russian Tortoise, Green Sea Turtle, Painted Turtle, Loggerhead Sea Turtle, Snapping Turtle]

Get element at index 2:
Green Sea Turtle

Set element at index 2:
Before: [Greek Tortoise, Russian Tortoise, Green Sea Turtle, Painted Turtle, Loggerhead Sea Turtle, Snapping Turtle]
After: [Greek Tortoise, Russian Tortoise, Egyptian Tortoise, Painted Turtle, Loggerhead Sea Turtle, Snapping Turtle]

indexOf Russian Tort:
1

Last index of Russian Tort: 6
[Greek Tortoise, Russian Tortoise, Egyptian Tortoise, Painted Turtle, Loggerhead Sea Turtle, Snapping Turtle, Russian Tortoise]

 Equals Russian Tort: false

Hash Code: 783410484

Is the arraylist empty: false

Does arraylist contain 'Russian Tortoise': true

Does arraylist contain Aquatic Turtle collection?: 
Aquatic Turtle collection: [Green Sea Turtle, Painted Turtle, Loggerhead Sea Turtle, Snapping Turtle]

Tortoise: [Greek Tortoise, Russian Tortoise, Egyptian Tortoise, Painted Turtle, Loggerhead Sea Turtle, Snapping Turtle, Russian Tortoise]

false

Does arraylist contain Aquatic Turtle collection?: 
New Aquatic Turtle collection: [Green Sea Turtle, Painted Turtle, Loggerhead Sea Turtle, Snapping Turtle]

Tortoise: [Greek Tortoise, Russian Tortoise, Egyptian Tortoise, Painted Turtle, Loggerhead Sea Turtle, Snapping Turtle, Russian Tortoise, Green Sea Turtle]

true

Unsorted: [Greek Tortoise, Russian Tortoise, Egyptian Tortoise, Painted Turtle, Loggerhead Sea Turtle, Snapping Turtle, Russian Tortoise, Green Sea Turtle]
Sorted using natural alphabetical order comparator: [Egyptian Tortoise, Greek Tortoise, Green Sea Turtle, Loggerhead Sea Turtle, Painted Turtle, Russian Tortoise, Russian Tortoise, Snapping Turtle]

Cleared list1:
[]
Cleared list2:
[]

Using Cars

import java.util.Scanner;

Scanner scan = new Scanner(System.in);
ArrayList<String> CarList = new ArrayList<String>();
boolean running = true;

System.out.println("Input 1 to add a car to favorite list, 2 to subtract a car from your favorite list, 3 to view the list, 4 to clear all, and 5 to end: ");
int inp = Integer.parseInt(scan.nextLine());

while(running){
    if(inp == 1){
        System.out.println("Input name of the car to add: ");
        String car = scan.nextLine();
        CarList.add(car);
        System.out.println("Input 1 to add a car to favorite list, 2 to subtract a car from your favorite list, 3 to view the list, 4 to clear all, and 5 to end: ");
        inp = Integer.parseInt(scan.nextLine());
    }
    else if(inp == 2){
        System.out.println("Input name of the car to delete: ");
        String car = scan.nextLine();
        CarList.remove(car);
        System.out.println("Input 1 to add a car to favorite list, 2 to subtract a car from your favorite list, 3 to view the list, 4 to clear all, and 5 to end: ");
        inp = Integer.parseInt(scan.nextLine());
    }
    else if(inp == 3){
        System.out.println(CarList);
        System.out.println("Input 1 to add a car to favorite list, 2 to subtract a car from your favorite list, 3 to view the list, 4 to clear all, and 5 to end: ");
        inp = Integer.parseInt(scan.nextLine());
    }
    else if(inp == 4){
        CarList.clear();
        System.out.println(CarList);
        System.out.println("Input 1 to add a car to favorite list, 2 to subtract a car from your favorite list, 3 to view the list, 4 to clear all, and 5 to end: ");
        inp = Integer.parseInt(scan.nextLine());
    }
    else{
        running = false;
    }
}
Input 1 to add a car to favorite list, 2 to subtract a car from your favorite list, 3 to view the list, 4 to clear all, and 5 to end: 
Input name of the car to add: 
Input 1 to add a car to favorite list, 2 to subtract a car from your favorite list, 3 to view the list, 4 to clear all, and 5 to end: 
[Honda Civic]
Input 1 to add a car to favorite list, 2 to subtract a car from your favorite list, 3 to view the list, 4 to clear all, and 5 to end: 
Input name of the car to add: 
Input 1 to add a car to favorite list, 2 to subtract a car from your favorite list, 3 to view the list, 4 to clear all, and 5 to end: 
[Honda Civic, Toyota Prius]
Input 1 to add a car to favorite list, 2 to subtract a car from your favorite list, 3 to view the list, 4 to clear all, and 5 to end: 
Input name of the car to add: 
Input 1 to add a car to favorite list, 2 to subtract a car from your favorite list, 3 to view the list, 4 to clear all, and 5 to end: 
[Honda Civic, Toyota Prius, Honda Prelude]
Input 1 to add a car to favorite list, 2 to subtract a car from your favorite list, 3 to view the list, 4 to clear all, and 5 to end: 
Input name of the car to delete: 
Input 1 to add a car to favorite list, 2 to subtract a car from your favorite list, 3 to view the list, 4 to clear all, and 5 to end: 
[Honda Civic, Honda Prelude]
Input 1 to add a car to favorite list, 2 to subtract a car from your favorite list, 3 to view the list, 4 to clear all, and 5 to end: 
[]
Input 1 to add a car to favorite list, 2 to subtract a car from your favorite list, 3 to view the list, 4 to clear all, and 5 to end: