### Question:
SyncDecoder extends ActiveSyncDecoder { @VisibleForTesting EncodedSyncCollectionCommandRequest getCommandRequest(Element commandElement) { SyncCommand syncCommand = SyncCommand.fromSpecificationValue(commandElement.getNodeName()); Element applicationDataElement = DOMUtils.getUniqueElement(commandElement, SyncRequestFields.APPLICATION_DATA.getName()); return EncodedSyncCollectionCommandRequest.builder() .type(syncCommand) .serverId(serverId(commandElement)) .clientId(uniqueStringFieldValue(commandElement, SyncRequestFields.CLIENT_ID)) .applicationData(applicationDataElement != null ? new EncodedApplicationData(applicationDataElement) : null) .build(); } @Inject protected  SyncDecoder(DecoderFactory decoderFactory); SyncRequest decodeSync(Document doc); SyncResponse decodeSyncResponse(Document responseDocument);  }### Answer:
@Test public void testCollectionCommandsServerIdIsNotRequired() throws Exception { Document request = DOMUtils.parse( "<Add>" + "<ClientId>120</ClientId>" + "<ApplicationData>" + "<Email1Address>\"opush@obm.org\"&lt;opush@obm.org&gt;</Email1Address>" + "<FileAs>Dobney, JoLynn Julie</FileAs>" + "<FirstName>JoLynn</FirstName>" + "</ApplicationData>" + "</Add>"); EncodedSyncCollectionCommandRequest command = new SyncDecoder(decoder).getCommandRequest(request.getDocumentElement()); assertThat(command.getServerId()).isNull(); }
@Test public void testCollectionCommandsClientIdIsNotRequired() throws Exception { Document request = DOMUtils.parse( "<Add>" + "<ServerId>12</ServerId>" + "<ApplicationData>" + "<Email1Address>\"opush@obm.org\"&lt;opush@obm.org&gt;</Email1Address>" + "<FileAs>Dobney, JoLynn Julie</FileAs>" + "<FirstName>JoLynn</FirstName>" + "</ApplicationData>" + "</Add>"); EncodedSyncCollectionCommandRequest command = new SyncDecoder(decoder).getCommandRequest(request.getDocumentElement()); assertThat(command.getClientId()).isNull(); }