CompleteSnapshotBridgeParameters { public String serialize() { JaxbJsonSerializer<CompleteSnapshotBridgeParameters> serializer = new JaxbJsonSerializer<>(CompleteSnapshotBridgeParameters.class); try { return serializer.serialize(this); } catch (IOException e) { throw new SnapshotDataException( "Unable to create task result due to: " + e.getMessage()); } } CompleteSnapshotBridgeParameters();  CompleteSnapshotBridgeParameters(List<String> alternateIds); List<String> getAlternateIds(); void setAlternateIds(List<String> alternateIds); String serialize();  }
@Test public void testSerialize() { String idOne = "alt-id-one"; String idTwo = "alt-id-two"; List<String> alternateIds = Arrays.asList(idOne, idTwo); CompleteSnapshotBridgeParameters params = new CompleteSnapshotBridgeParameters(alternateIds); String result = params.serialize(); String cleanResult = result.replaceAll("\\s+", ""); assertThat(cleanResult, containsString("\"alternateIds\":[\"" + idOne + "\",\"" + idTwo + "\"]")); }