Util { public static <T> ListenableFuture<RpcResult<T>> resultRpcSuccessFor(final T output) { return Futures.immediateFuture(RpcResultBuilder.success(output).build()); } private  Util(); static ListenableFuture<RpcResult<T>> resultRpcSuccessFor(final T output); static List<SchemaPath> expandQname(final List<SchemaPath> list, final Pattern pattern); static String wildcardToRegex(final String wildcard);  }
@Test public void testResultFor() throws Exception { { final String expectedResult = "dummy string"; RpcResult<String> rpcResult = Util.resultRpcSuccessFor(expectedResult).get(); assertEquals(expectedResult, rpcResult.getResult()); assertTrue(rpcResult.isSuccessful()); assertTrue(rpcResult.getErrors().isEmpty()); } { final Integer expectedResult = 42; RpcResult<Integer> rpcResult = Util.resultRpcSuccessFor(expectedResult).get(); assertEquals(expectedResult, rpcResult.getResult()); assertTrue(rpcResult.isSuccessful()); assertTrue(rpcResult.getErrors().isEmpty()); } }