// Path: src/main/java/ch/rasc/wampspring/message/CallMessage.java
// public class CallMessage extends WampMessage {
// 	private final String callID;
// 
// 	private final String procURI;
// 
// 	private final List<Object> arguments;
// 
// 	public CallMessage(String callID, String procURI, Object... arguments) {
// 		super(WampMessageType.CALL);
// 		this.callID = callID;
// 		this.procURI = procURI;
// 		if (arguments != null) {
// 			this.arguments = Arrays.asList(arguments);
// 		}
// 		else {
// 			this.arguments = null;
// 		}
// 
// 	}
// 
// 	public CallMessage(JsonParser jp) throws IOException {
// 		this(jp, null);
// 	}
// 
// 	public CallMessage(JsonParser jp, WampSession wampSession) throws IOException {
// 		super(WampMessageType.CALL);
// 
// 		if (jp.nextToken() != JsonToken.VALUE_STRING) {
// 			throw new IOException();
// 		}
// 		this.callID = jp.getValueAsString();
// 
// 		if (jp.nextToken() != JsonToken.VALUE_STRING) {
// 			throw new IOException();
// 		}
// 		this.procURI = replacePrefix(jp.getValueAsString(), wampSession);
// 
// 		List<Object> args = new ArrayList<>();
// 		while (jp.nextToken() != JsonToken.END_ARRAY) {
// 			args.add(jp.readValueAs(Object.class));
// 		}
// 
// 		if (!args.isEmpty()) {
// 			this.arguments = Collections.unmodifiableList(args);
// 		}
// 		else {
// 			this.arguments = null;
// 		}
// 	}
// 
// 	public String getCallID() {
// 		return this.callID;
// 	}
// 
// 	public String getProcURI() {
// 		return this.procURI;
// 	}
// 
// 	public List<Object> getArguments() {
// 		return this.arguments;
// 	}
// 
// 	@Override
// 	public String getDestination() {
// 		return this.procURI;
// 	}
// 
// 	@Override
// 	public String toJson(JsonFactory jsonFactory) throws IOException {
// 		try (StringWriter sw = new StringWriter();
// 				JsonGenerator jg = jsonFactory.createGenerator(sw)) {
// 			jg.writeStartArray();
// 			jg.writeNumber(getTypeId());
// 			jg.writeString(this.callID);
// 			jg.writeString(this.procURI);
// 			if (this.arguments != null) {
// 				for (Object argument : this.arguments) {
// 					jg.writeObject(argument);
// 				}
// 			}
// 
// 			jg.writeEndArray();
// 			jg.close();
// 			return sw.toString();
// 		}
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "CallMessage [callID=" + this.callID + ", procURI=" + this.procURI
// 				+ ", arguments=" + this.arguments + "]";
// 	}
// 
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.util.UUID;
import org.junit.Test;
import org.springframework.messaging.Message;
import org.springframework.util.AntPathMatcher;
import ch.rasc.wampspring.message.CallMessage;
		DestinationPatternsMessageCondition c2 = condition("/foo*");

		assertEquals(0, c1.compareTo(c2, messageTo("/foo")));
	}

	@Test
	public void comparePatternSpecificity() {
		DestinationPatternsMessageCondition c1 = condition("/fo*");
		DestinationPatternsMessageCondition c2 = condition("/foo");

		assertEquals(1, c1.compareTo(c2, messageTo("/foo")));
	}

	@Test
	public void compareNumberOfMatchingPatterns() throws Exception {
		Message<?> message = messageTo("/foo");

		DestinationPatternsMessageCondition c1 = condition("/foo", "/bar");
		DestinationPatternsMessageCondition c2 = condition("/foo", "/f*");

		DestinationPatternsMessageCondition match1 = c1.getMatchingCondition(message);
		DestinationPatternsMessageCondition match2 = c2.getMatchingCondition(message);

		assertEquals(1, match1.compareTo(match2, message));
	}

	private static DestinationPatternsMessageCondition condition(String... patterns) {
		return new DestinationPatternsMessageCondition(patterns, new AntPathMatcher());
	}

// Path: src/main/java/ch/rasc/wampspring/message/CallMessage.java
// public class CallMessage extends WampMessage {
// 	private final String callID;
// 
// 	private final String procURI;
// 
// 	private final List<Object> arguments;
// 
// 	public CallMessage(String callID, String procURI, Object... arguments) {
// 		super(WampMessageType.CALL);
// 		this.callID = callID;
// 		this.procURI = procURI;
// 		if (arguments != null) {
// 			this.arguments = Arrays.asList(arguments);
// 		}
// 		else {
// 			this.arguments = null;
// 		}
// 
// 	}
// 
// 	public CallMessage(JsonParser jp) throws IOException {
// 		this(jp, null);
// 	}
// 
// 	public CallMessage(JsonParser jp, WampSession wampSession) throws IOException {
// 		super(WampMessageType.CALL);
// 
// 		if (jp.nextToken() != JsonToken.VALUE_STRING) {
// 			throw new IOException();
// 		}
// 		this.callID = jp.getValueAsString();
// 
// 		if (jp.nextToken() != JsonToken.VALUE_STRING) {
// 			throw new IOException();
// 		}
// 		this.procURI = replacePrefix(jp.getValueAsString(), wampSession);
// 
// 		List<Object> args = new ArrayList<>();
// 		while (jp.nextToken() != JsonToken.END_ARRAY) {
// 			args.add(jp.readValueAs(Object.class));
// 		}
// 
// 		if (!args.isEmpty()) {
// 			this.arguments = Collections.unmodifiableList(args);
// 		}
// 		else {
// 			this.arguments = null;
// 		}
// 	}
// 
// 	public String getCallID() {
// 		return this.callID;
// 	}
// 
// 	public String getProcURI() {
// 		return this.procURI;
// 	}
// 
// 	public List<Object> getArguments() {
// 		return this.arguments;
// 	}
// 
// 	@Override
// 	public String getDestination() {
// 		return this.procURI;
// 	}
// 
// 	@Override
// 	public String toJson(JsonFactory jsonFactory) throws IOException {
// 		try (StringWriter sw = new StringWriter();
// 				JsonGenerator jg = jsonFactory.createGenerator(sw)) {
// 			jg.writeStartArray();
// 			jg.writeNumber(getTypeId());
// 			jg.writeString(this.callID);
// 			jg.writeString(this.procURI);
// 			if (this.arguments != null) {
// 				for (Object argument : this.arguments) {
// 					jg.writeObject(argument);
// 				}
// 			}
// 
// 			jg.writeEndArray();
// 			jg.close();
// 			return sw.toString();
// 		}
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "CallMessage [callID=" + this.callID + ", procURI=" + this.procURI
// 				+ ", arguments=" + this.arguments + "]";
// 	}
// 
// }


// Path: src/test/java/ch/rasc/wampspring/method/DestinationPatternsMessageConditionTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.util.UUID;
import org.junit.Test;
import org.springframework.messaging.Message;
import org.springframework.util.AntPathMatcher;
import ch.rasc.wampspring.message.CallMessage;

		DestinationPatternsMessageCondition c2 = condition("/foo*");

		assertEquals(0, c1.compareTo(c2, messageTo("/foo")));
	}

	@Test
	public void comparePatternSpecificity() {
		DestinationPatternsMessageCondition c1 = condition("/fo*");
		DestinationPatternsMessageCondition c2 = condition("/foo");

		assertEquals(1, c1.compareTo(c2, messageTo("/foo")));
	}

	@Test
	public void compareNumberOfMatchingPatterns() throws Exception {
		Message<?> message = messageTo("/foo");

		DestinationPatternsMessageCondition c1 = condition("/foo", "/bar");
		DestinationPatternsMessageCondition c2 = condition("/foo", "/f*");

		DestinationPatternsMessageCondition match1 = c1.getMatchingCondition(message);
		DestinationPatternsMessageCondition match2 = c2.getMatchingCondition(message);

		assertEquals(1, match1.compareTo(match2, message));
	}

	private static DestinationPatternsMessageCondition condition(String... patterns) {
		return new DestinationPatternsMessageCondition(patterns, new AntPathMatcher());
	}

	private static CallMessage messageTo(String destination) {