Custom ImmutableList Java. This is a custom list in java which will take array list as a constructor and creates a immutable list out of it. Provides helper functions to retrieve the data
ImmutableList immutableList = new ImmutableList(arrayList);
//immutableList is arraylist of immutable object with a new reference
Returns the first element of a list.
Returns a new list with all elements of the original list except the first.
Takes an argument and prepends it to the list.
Takes an integer ‘n’ as argument and returns a new list after removing first n elements from the list.
Returns the reverse of a list.
Takes a predicate(function, lambda or anonymous class) as an argument and returns a list only containing the elements which satisfy that predicate
Each one of the above operations return a new list with the input list left intact.