@Test public void wrapMockedConnection() throws SQLException { final Connection connection = mock(Connection.class); final Connection proxy = CloseSuppressedConnectionFactory.createProxy(connection); assertNotNull(proxy); proxy.close(); verifyZeroInteractions(connection); }
public static Connection createProxy(final Connection connection) { Objects.requireNonNull(connection, "The \"connection\" argument can not be null"); return (Connection) createConnectionProxy(connection); }
CloseSuppressedConnectionFactory { public static Connection createProxy(final Connection connection) { Objects.requireNonNull(connection, "The \"connection\" argument can not be null"); return (Connection) createConnectionProxy(connection); } }
CloseSuppressedConnectionFactory { public static Connection createProxy(final Connection connection) { Objects.requireNonNull(connection, "The \"connection\" argument can not be null"); return (Connection) createConnectionProxy(connection); } private  CloseSuppressedConnectionFactory(); }
CloseSuppressedConnectionFactory { public static Connection createProxy(final Connection connection) { Objects.requireNonNull(connection, "The \"connection\" argument can not be null"); return (Connection) createConnectionProxy(connection); } private  CloseSuppressedConnectionFactory(); static Connection createProxy(final Connection connection); }
CloseSuppressedConnectionFactory { public static Connection createProxy(final Connection connection) { Objects.requireNonNull(connection, "The \"connection\" argument can not be null"); return (Connection) createConnectionProxy(connection); } private  CloseSuppressedConnectionFactory(); static Connection createProxy(final Connection connection);  }