Immutable object in Java Concurrency.
List<Table> allTables = ImmutableList.copyOf(Table.values());
final String value1;
final Boolean blue;
private Session(String value1, boolean isBlue)
{
this.value1 = value1;
this.isBlue = isBlue;
}
public Session withBlue(boolean isBlue)
{
return new Session(
this.value1,
this.isBlue
);
}
since Java10, Create new collection instances from existing instances
Stream New methods toUnmodifiableList, toUnmodifiableSet, and toUnmodifiableMap have been added to the Collectors class in the Stream package.