/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.time.* ;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
Map
< DayOfWeek ,
String > dailyAssignment
= new EnumMap
<>( DayOfWeek.
class ) ;dailyAssignment.put( DayOfWeek.MONDAY, "Alice" ) ;
dailyAssignment.put( DayOfWeek.TUESDAY, "Bob" ) ;
dailyAssignment.put( DayOfWeek.SATURDAY, "Bob" ) ;
dailyAssignment.put( DayOfWeek.SUNDAY, "Carol" ) ;
List
< DayOfWeek
> weekend
= List.
of( DayOfWeek.
SATURDAY , DayOfWeek.
SUNDAY ) ;
Map
< DayOfWeek ,
String > weekendAssignment
= new EnumMap
<>( dailyAssignment
) ;weekendAssignment.keySet().retainAll( weekend ) ;
System.
out.
println( "dailyAssignment.toString(): " + dailyAssignment
) ; System.
out.
println( "weekendAssignment.toString(): " + weekendAssignment
) ; }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgppbXBvcnQgamF2YS50aW1lLiogOyAKCi8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7Ck1hcDwgRGF5T2ZXZWVrICwgU3RyaW5nID4gZGFpbHlBc3NpZ25tZW50ID0gbmV3IEVudW1NYXA8PiggRGF5T2ZXZWVrLmNsYXNzICkgOwpkYWlseUFzc2lnbm1lbnQucHV0KCBEYXlPZldlZWsuTU9OREFZLCAiQWxpY2UiICkgOwpkYWlseUFzc2lnbm1lbnQuc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