void (final String... args) { for (final A<String, X> a : Arrays.<A<String, X>>asList(new A<String, X>() { @Override public String foo(final String ignored) throws X { throw new X(); } }, ignored -> { throw new X(); })) try { test(a, "Bob"); } catch (final X x) { x.printStackTrace(); } try { out.println(test(new A<String, X>() { @Override public String foo(final String ignored) throws X { throw new X(); } }, "Bob")); } catch (final Exception e) { e.printStackTrace(); } try { out.println(test(ignored -> { throw new X(); }, "Bob")); } catch (final Exception e) { e.printStackTrace(); } }