cases like "", null are not covered. how about adding unit tests for resolveHostName() too?