Use TypeReference:
TypeReference
public <T> ResultPage<T> parseResultPage(String content, Class<T> resultType) throws IOException { TypeReference<ResultPage<T>> typeRef = new TypeReference<>() {}; return new ObjectMapper().readValue(in, typeRef); }