@Test public void close() throws IOException { ButtonInputDriver driver = new ButtonInputDriver(mButton, 0); driver.close(); Mockito.verify(mButton).close(); }
@Override public void close() throws IOException { unregister(); if (mDevice != null) { try { mDevice.close(); } finally { mDevice = null; } } }
ButtonInputDriver implements AutoCloseable { @Override public void close() throws IOException { unregister(); if (mDevice != null) { try { mDevice.close(); } finally { mDevice = null; } } } }
ButtonInputDriver implements AutoCloseable { @Override public void close() throws IOException { unregister(); if (mDevice != null) { try { mDevice.close(); } finally { mDevice = null; } } } ButtonInputDriver(String pin, Button.LogicState logicLevel, int keycode); @VisibleForTesting  ButtonInputDriver(Button button, int keycode); }
ButtonInputDriver implements AutoCloseable { @Override public void close() throws IOException { unregister(); if (mDevice != null) { try { mDevice.close(); } finally { mDevice = null; } } } ButtonInputDriver(String pin, Button.LogicState logicLevel, int keycode); @VisibleForTesting  ButtonInputDriver(Button button, int keycode); void setDebounceDelay(long delay); @Override void close(); void register(); void unregister(); }
ButtonInputDriver implements AutoCloseable { @Override public void close() throws IOException { unregister(); if (mDevice != null) { try { mDevice.close(); } finally { mDevice = null; } } } ButtonInputDriver(String pin, Button.LogicState logicLevel, int keycode); @VisibleForTesting  ButtonInputDriver(Button button, int keycode); void setDebounceDelay(long delay); @Override void close(); void register(); void unregister();  }