Pickle (TestCase testCase) { try { Field cucumberPickleField = testCase.getClass().getDeclaredField("pickle"); cucumberPickleField.setAccessible(true); Object cucumberPickle = cucumberPickleField.get(testCase); Field pickleField = cucumberPickle.getClass().getDeclaredField("pickle"); pickleField.setAccessible(true); return (Pickle) pickleField.get(cucumberPickle); } catch (Exception ignored) { } return null; }