@Test
public void testComplexServiceClassEmitClass() {

    ServiceModel model = serviceClassParser.parseServiceClass(TestComplexServiceClass.class, settings);
    ServiceEmitter serviceEmitter = new ServiceEmitter(model, settings, writer);
    serviceEmitter.emitTypescriptClass();
    writer.close();
    String expectedOutput = "\n" +
ort class TestComplexServiceClassImpl implements TestComplexServiceClass {\n" +
 +
 private httpApiBridge: HttpApiBridge;\n" +
 constructor(httpApiBridge: HttpApiBridge) {\n" +
     this.httpApiBridge = httpApiBridge;\n" +
 }\n" +
 +
 public allOptionsPost(a: string, dataObject: DataObject, b?: number) {\n" +
     var httpCallData = <HttpEndpointOptions> {\n" +
         serviceIdentifier: \"testComplexServiceClass\",\n" +
         endpointPath: \"testComplexService/allOptionsPost/{a}\",\n" +
         endpointName: \"allOptionsPost\",\n" +
         method: \"POST\",\n" +
         requestMediaType: \"application/json\",\n" +
         responseMediaType: \"\",\n" +
         requiredHeaders: [],\n" +
         pathArguments: [a],\n" +
         queryArguments: {\n" +
             b: b,\n" +
         },\n" +
         data: dataObject\n" +
     };\n" +
     return this.httpApiBridge.callEndpoint<GenericObject<MyObject>>(httpCallData);\n" +
 }\n" +
 +
 public queryGetter(x?: boolean) {\n" +
     var httpCallData = <HttpEndpointOptions> {\n" +
         serviceIdentifier: \"testComplexServiceClass\",\n" +
         endpointPath: \"testComplexService/queryGetter\",\n" +
         endpointName: \"queryGetter\",\n" +
         method: \"GET\",\n" +
         requestMediaType: \"application/json\",\n" +
         responseMediaType: \"\",\n" +
         requiredHeaders: [],\n" +
         pathArguments: [],\n" +
         queryArguments: {\n" +
             x: x,\n" +
         },\n" +
         data: null\n" +
     };\n" +
     return this.httpApiBridge.callEndpoint<MyObject>(httpCallData);\n" +
 }\n" +
 +
 public simplePut(dataObject: DataObject) {\n" +
     var httpCallData = <HttpEndpointOptions> {\n" +
         serviceIdentifier: \"testComplexServiceClass\",\n" +
         endpointPath: \"testComplexService/simplePut\",\n" +
         endpointName: \"simplePut\",\n" +
         method: \"PUT\",\n" +
         requestMediaType: \"application/json\",\n" +
         responseMediaType: \"\",\n" +
         requiredHeaders: [],\n" +
         pathArguments: [],\n" +
         queryArguments: {\n" +
         },\n" +
         data: dataObject\n" +
     };\n" +
     return this.httpApiBridge.callEndpoint<ImmutablesObject>(httpCallData);\n" +
 }\n" +
";
    assertEquals(expectedOutput, new String(stream.toByteArray()));
}