Recently I wrote a small piece of code for my project need and the code works fine...if (Utils.nullOrEmpty(string1))    {        Config config = getConfig();        if (config != null)        {            doX();        }    }    else    {        doY();    }    if (Utils.nullOrEmpty(string2))    {        Config config = getConfig();        if (config != null)        {            doA();        }    }    else    {        doB();    }I am not convinced the way it is written and I feel there is a scope for improvement to make it better........Please give me some suggestions to make it better... Is there a scope to use lambdas ??.........
Same computational flow, but different functionalities
java;object oriented;design patterns