@Override public boolean test(StandardMessage testMsg) { if (!(testMsg instanceof Response)) return false; Response response = (Response) testMsg; if (id != null) { if (!response.getMessageId().equals(id)) return false; } if (responseCode != null) { if (!(response.getResponseCode().getCode() == responseCode.getCode())) return false; } return true; }