Here's the process ..
The following sits inside a @BeforeClass ..
TestRail testRail = TestRail.builder("endpoint", "username", "password").build();
Run newTestRun = testRail.runs().add(24, new Run().setSuiteId(9694).setName("Automated Regression Suite")).execute();
List<Test> tests = Collections.unmodifiableList(testRail.tests().list(newTestRun.getId()).execute());
List<ResultField> customResultFields = Collections.unmodifiableList(testRail.resultFields().list().execute());
and the following sits inside the after hook ..
testRail.results().add(testID, new Result().setStatusId(testRailTestResult), customResultFields).execute();
Occasionally I'm getting the exception thrown by the line in the after hook.