/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.stream.* ;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
Map
<String, List
<String
>> map
= Map.
ofEntries( Map.
entry( "Download",
List.
of( "Download",
"Downloading",
"Downloaded" ) ) ,
Map.
entry( "Upload",
List.
of( "Upload",
"Uploading",
"Uploaded" ) ) );
map
.entrySet()
.stream()
.
filter( ( Map.Entry < String, List
<String
> > entry
) -> entry.
getValue().
contains( s
) ) .collect( Collectors.toUnmodifiableList() ) // Or replace with `.toList()` in more modern Java.
;
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwuc3RyZWFtLiogOwoKLyogTmFtZSBvZiB0aGUgY2xhc3MgaGFzIHRvIGJlICJNYWluIiBvbmx5IGlmIHRoZSBjbGFzcyBpcyBwdWJsaWMuICovCmNsYXNzIElkZW9uZQp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQlTdHJpbmcgcyA9ICJEb3dubG9hZGVkIjsKICAgICAgICBNYXA8U3RyaW5nLCBMaXN0PFN0cmluZz4+IG1hcCA9IE1hcC5vZkVudHJpZXMoCiAgICAgICAgICAgICAgICBNYXAuZW50cnkoICJEb3dubG9hZCIsIExpc3Qub2YoICJEb3dubG9hZCIsICJEb3dubG9hZGluZyIsICJEb3dubG9hZGVkIiApICkgLAogICAgICAgICAgICAgICAgTWFwLmVudHJ5KCAiVXBsb2FkIiwgTGlzdC5vZiggIlVwbG9hZCIsICJVcGxvYWRpbmciLCAiVXBsb2FkZWQiICkgKQogICAgICAgICk7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCBtYXAgKSA7CgogICAgICAgIENvbGxlY3Rpb24gPCBTdHJpbmcgPiBrZXlzID0KICAgICAgICAgICAgbWFwCiAgICAgICAgICAgICAgICAuZW50cnlTZXQoKQogICAgICAgICAgICAgICAgLnN0cmVhbSgpCiAgICAgICAgICAgICAgICAuZmlsdGVyKCAoIE1hcC5FbnRyeSA8IFN0cmluZywgTGlzdDxTdHJpbmc+ID4gZW50cnkgKSAtPiBlbnRyeS5nZXRWYWx1ZSgpLmNvbnRhaW5zKCBzICkgKQogICAgICAgICAgICAgICAgLm1hcCggTWFwLkVudHJ5IDo6IGdldEtleSApCiAgICAgICAgICAgICAgICAuY29sbGVjdCggQ29sbGVjdG9ycy50b1VubW9kaWZpYWJsZUxpc3QoKSApICAvLyBPciByZXBsYWNlIHdpdGggYC50b0xpc3QoKWAgaW4gbW9yZSBtb2Rlcm4gSmF2YS4KICAgICAgICA7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCBrZXlzICkgOwoJfQp9