I'm migrating a project from c# to java and i have problem with TryGetValue() method!

here is the c# code:

```
private static void _AddBadQualityChar (Dictionary<string,List<string>> badQualityChars, string charString, string badQualityChar)
        {
            List<string>        _badQualityChars;

            if (!badQualityChars.TryGetValue (charString, out _badQualityChars))
            {
                _badQualityChars = new List<string> ();
                badQualityChars [charString] = _badQualityChars;
            }

            _badQualityChars.Add (badQualityChar);
        }

```

I don't know whats the equivalent of TryGetValue() method in java map all I could found is get() method which doesn't return Boolean ! how can I write this function in Java?