@AfterClass public static void tearDownAfterClass() { try { container.shutdown(); } catch (Exception e) { } }
public List<User> getUsers() { HttpClientContainer container = null; List<User> friendsList; try { container = injector.getInstance(HttpClientContainer.class); Friends friends = injector.getInstance(Friends.class); String selfUid = injector.getInstance(AuthHelper.class).getSelfUid(); friendsList = friends.get(selfUid); } finally { try { container.shutdown(); } catch (Exception e) { } } return friendsList; }
@Override protected void finalize() throws Throwable { shutdown(); super.finalize(); }