PostgreSQLFrontendEngine implements DatabaseProtocolFrontendEngine { @Override public void release(final BackendConnection backendConnection) { BinaryStatementRegistry.getInstance().unregister(backendConnection.getConnectionId()); }  @Override String getDatabaseType(); @Override void release(final BackendConnection backendConnection);  }
@Test public void assertRelease() { BackendConnection backendConnection = mock(BackendConnection.class); int connectionId = 1; when(backendConnection.getConnectionId()).thenReturn(connectionId); BinaryStatementRegistry registry = BinaryStatementRegistry.getInstance(); registry.register(connectionId); assertNotNull(registry.get(connectionId)); PostgreSQLFrontendEngine frontendEngine = new PostgreSQLFrontendEngine(); frontendEngine.release(backendConnection); assertNull(registry.get(connectionId)); }