@Test
    public void shouldNotApplySecondIfFirstFails() {
        final List<String> l = new ArrayList<>();
        final TriConsumer<String, String, String> f = (a, b, c) -> {
            throw new RuntimeException();
        };
        final TriConsumer<String, String, String> after = (a, b, c) -> l.add("second");

        try {
            f.andThen(after).accept("a", "b", "c");
            fail("Should have throw an exception");
        } catch (RuntimeException re) {
            assertEquals(0, l.size());
        }
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/util/function/TriConsumerTest.java