SearchBuilder implements Builder<Search> { public static SearchBuilder fromJson(String json) { try { return JsonSerializer.fromString(json, SearchBuilder.class); } catch (IOException e) { return SearchBuilderLegacy.fromJson(json); } } SearchBuilder(); SearchBuilder filter(ConditionBuilder<?, ?>... builders); SearchBuilder query(ConditionBuilder<?, ?>... builders); SearchBuilder sort(SortFieldBuilder... builders); SearchBuilder refresh(boolean refresh); SearchBuilder paging(IndexPagingState pagingState); @Override Search build(); String toJson(); static SearchBuilder fromJson(String json);  }
@Test(expected = IndexException.class) public void testFromJsonInvalid() { SearchBuilder.fromJson("error"); }