SecurityScheme securityScheme = new SecurityScheme();
securityScheme.setDescribedBy(describedBy);
securityScheme.setSettings(new SecuritySettings());
Raml raml = new Raml();
raml.setTitle("hi");
raml.setBaseUriParameters(buildMap(new UriParameter()));
raml.setDocumentation(Collections.singletonList(new DocumentationItem()));
raml.setResources(buildMap(resource));
raml.setProtocols(Collections.singletonList(Protocol.HTTP));
raml.setResourceTypes(Collections.singletonList(buildMap(new Template())));
raml.setTraits(Collections.singletonList(buildMap(new Template())));
raml.setSecuritySchemes(Collections.singletonList(buildMap(securityScheme)));
raml.setSecuredBy(Collections.singletonList(new SecurityReference("ref")));
byte[] bytes = SerializationUtils.serialize(raml);
Raml copy = (Raml) SerializationUtils.deserialize(bytes);
assertThat(copy.getTitle(), is(raml.getTitle()));
}