### Question:
TransportBinding { public static TransportBinding parse(String binding) throws TransportBindingParseException { switch (binding) { case "U": return new TransportBinding(true, false, false); case "UQ": return new TransportBinding(true, false, true); case "S": return new TransportBinding(false, true, false); case "SQ": return new TransportBinding(false, true, true); case "US": return new TransportBinding(true, true, false); case "UQS": return new TransportBinding(true, true, true); default: throw new TransportBindingParseException(); } } TransportBinding(boolean isUDP, boolean isSMS, boolean isQueueMode); static TransportBinding parse(String binding); boolean isQueueMode(); boolean isSMS(); boolean isUDP(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static final TransportBinding DEFAULT; }### Answer:
@Test public void parse() throws TransportBindingParseException { assertEquals(new TransportBinding(true, false, false), TransportBinding.parse("U")); assertEquals(new TransportBinding(false, true, false), TransportBinding.parse("S")); assertEquals(new TransportBinding(true, false, true), TransportBinding.parse("UQ")); assertEquals(new TransportBinding(true, true, true), TransportBinding.parse("UQS")); assertEquals(new TransportBinding(false, true, true), TransportBinding.parse("SQ")); assertEquals(new TransportBinding(true, true, false), TransportBinding.parse("US")); assertTrue(TransportBinding.parse("SQ").isQueueMode()); assertTrue(TransportBinding.parse("SQ").isSMS()); assertFalse(TransportBinding.parse("SQ").isUDP()); }