driver.manage().getCookieNamed(cookieName) is not working

Appium version: 1.5.2
Appium Java-client version: 3.4.1
Device OS: iOS Phone

driver.manage().getCookieNamed(cookieName) is not working and it returns NullPointerException. If I however write a for loop and get all the cookie names i.e. cookie.getName(), it correctly prints the cookie that I added.

Set cookies = appiumDriver.manage().getCookies();
Cookie testCookie = new Cookie(“hello”, “test-cookie”);
cookies.add(testCookie);

appiumDriver.manage().getCookieNamed("hello").getValue() returns NullPointerException

Can someone please let me know what could be going wrong or is this a bug?

Appium Logs:
[HTTP] --> GET /wd/hub/session/62ff4c65-6829-412d-b45d-4c7bae17f843/cookie {}
[MJSONWP] Calling AppiumDriver.getCookies() with args: [“62ff4c65-6829-412d-b45d-4c7bae17f843”]
[debug] [iOS] Executing iOS command ‘getCookies’
[debug] [iOS] Retrieving all cookies
[debug] [RemoteDebugger] Executing ‘execute_script’ atom in default context
[debug] [RemoteDebugger] Sending javascript command (function(){return function…
[debug] [RemoteDebugger] Sending WebKit data: {“method”:"Runtime.evaluate…
[debug] [RemoteDebugger] Receiving WebKit data: {“result”:{“result”:{“type”…
[debug] [RemoteDebugger] Found handler for message ‘1’
[debug] [RemoteDebugger] Received result for atom ‘execute_script’ execution: “country=IN; __gads=ID=ea0429f016eb44b6:T=1463255325:S=ALNI_MaTeYRmdEh0urSpd6lwmMrqk9neVQ; __qca=P0-884307894-1463255329876; _ga=GA1.2.2111782018.1463255325; _gat_UA-350786-8=1; _vis_opt_exp_1_combi=2; _vis_opt_exp_1_split=2; _vis_opt_s=1%7C; _vwo_uuid=8FE3B35CF2C5B4B2E1AB0A95917E39CB; _vwo_uuid_v1=; _vwo_uuid_v2=67DD99A0835DDA3E2678DE63DF2F5566|146e0df05cbef90950652762ef875e10; Apache=10.236.12.68.1463255324242060”

[MJSONWP] Responding to client with driver.getCookies() result: [{“name”:“country”,“value”:“IN”},{“name”:"__gads",“value”:“ID”},{“name”:"__qca",“value”:“P0-884307894-1463255329876”},{“name”:"_ga",“value”:"GA1.2…

[HTTP] <-- GET /wd/hub/session/62ff4c65-6829-412d-b45d-4c7bae17f843/cookie 200 507 ms - 663

[HTTP] --> GET /wd/hub/session/62ff4c65-6829-412d-b45d-4c7bae17f843/cookie {}
[MJSONWP] Calling AppiumDriver.getCookies() with args: [“62ff4c65-6829-412d-b45d-4c7bae17f843”]
[debug] [iOS] Executing iOS command ‘getCookies’
[debug] [iOS] Retrieving all cookies
[debug] [RemoteDebugger] Executing ‘execute_script’ atom in default context
[debug] [RemoteDebugger] Sending javascript command (function(){return function…
[debug] [RemoteDebugger] Sending WebKit data: {“method”:"Runtime.evaluate…
[debug] [RemoteDebugger] Receiving WebKit data: {“result”:{“result”:{“type”…
[debug] [RemoteDebugger] Found handler for message ‘2’
[debug] [RemoteDebugger] Received result for atom ‘execute_script’ execution: “country=IN; __gads=ID=ea0429f016eb44b6:T=1463255325:S=ALNI_MaTeYRmdEh0urSpd6lwmMrqk9neVQ; __qca=P0-884307894-1463255329876; _ga=GA1.2.2111782018.1463255325; _gat_UA-350786-8=1; _vis_opt_exp_1_combi=2; _vis_opt_exp_1_split=2; _vis_opt_s=1%7C; _vwo_uuid=8FE3B35CF2C5B4B2E1AB0A95917E39CB; _vwo_uuid_v1=; _vwo_uuid_v2=67DD99A0835DDA3E2678DE63DF2F5566|146e0df05cbef90950652762ef875e10; Apache=10.236.12.68.1463255324242060”

[MJSONWP] Responding to client with driver.getCookies() result: [{“name”:“country”,“value”:“IN”},{“name”:"__gads",“value”:“ID”},{“name”:"__qca",“value”:“P0-884307894-1463255329876”},{“name”:"_ga",“value”:"GA1.2…