DefaultQueryProxy implements Serializable { public static DefaultQueryProxy createFrom(DefaultQuery<String, Word<String>> query) { DefaultQueryProxy newProxy = new DefaultQueryProxy(); if (query != null) { newProxy.prefix = query.getPrefix().asList(); newProxy.suffix = query.getSuffix().asList(); if (query.getOutput() != null) { newProxy.output = query.getOutput().asList(); } } return newProxy; } DefaultQueryProxy(); static DefaultQueryProxy createFrom(DefaultQuery<String, Word<String>> query); @Transient @JsonProperty List<String> getPrefix(); void setPrefix(List<String> prefix); @Transient @JsonProperty List<String> getSuffix(); void setSuffix(List<String> suffix); @Transient @JsonProperty List<String> getOutput(); void setOutput(List<String> output); @Column(name = "counterExample", columnDefinition = "MEDIUMTEXT") @JsonIgnore String getProxyDB(); @JsonIgnore void setProxyDB(String proxyAsString); DefaultQuery<String, Word<String>> createDefaultQuery(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void shouldSerializeCorrectly() throws Exception { final DefaultQuery<String, Word<String>> query = createQuery(); final DefaultQueryProxy queryProxy = DefaultQueryProxy.createFrom(query); final String queryString = om.writeValueAsString(queryProxy); final String expectedQueryString = "{\"prefix\":[],\"suffix\":[\"a\",\"b\"],\"output\":[\"1\",\"2\"]}"; JSONAssert.assertEquals(expectedQueryString, queryString, true); }