String result = null;
if (!(actual instanceof Proxy)) {
result = "Objects do not match. Expected: " + expected +
" vs actual: " + actual;
} else {
Proxy eProxy = (Proxy) expected;
Proxy aProxy = (Proxy) actual;
if (!eProxy.getId().equals(aProxy.getId())) {
result = "Proxy id value does not match";
} else if (!(eProxy.getPort() == aProxy.getPort())) {
result = "Proxy port value does not match";
} else if ((eProxy.getHost() != null) &&
(aProxy.getHost() != null) &&
!eProxy.getHost().equals(aProxy.getHost())) {
result = "Proxy host value does not match";
} else if (((aProxy.getHost() == null) ||
(eProxy.getHost() == null))) {
if (aProxy.getHost() != eProxy.getHost()) {
result = "Proxy host value does not match " +
"(one value is null) expected: " +
eProxy.getHost() + " actual: " +
aProxy.getHost();
}
}
}
return result;
}