### Question:
OperationKeyMatcher implements Matcher { public void setType(String type) { if (type.equalsIgnoreCase("request")) { setType(OperationKey.Type.Request); } else if (type.equalsIgnoreCase("event")) { setType(OperationKey.Type.Event); } else { throw new IllegalArgumentException("Unsupported type: "+type); } }  String getServiceName(); void setServiceName(String serviceName); String getOperationName(); void setOperationName(String operationName); int getMajorVersion(); void setMajorVersion(int majorVersion); int getMinorVersion(); void setMinorVersion(int minorVersion); boolean isInverted(); void setInverted(boolean inverted); String getNamespace(); void setNamespace(String namespace); boolean isRequireNullNamespace(); void setRequireNullNamespace(boolean requireNullNamespace); OperationKey.Type getType(); void setType(String type); void setType(OperationKey.Type type); @Override boolean matches(ExecutionContext ctx, OperationKey key, Object[] args); boolean matches(OperationKey key); String toString();  }### Answer:
@Test public void typeMatching() { operationKeyMatcher.setType("event"); assertInvocation("With wrong type, key must fail to match", false); operationKeyMatcher.setType("request"); assertInvocation("With right type, key must match", true); }
@Test(expected = IllegalArgumentException.class) public void invalidTypeSpecified() { operationKeyMatcher.setType("wibble"); }