Ws2801 implements AutoCloseable { @Override public void close() throws IOException { device.close(); } Ws2801(SpiDevice device, ColorUnpacker colorUnpacker, Direction direction); static Ws2801 create(String spiBusPort); static Ws2801 create(String spiBusPort, Mode ledMode); static Ws2801 create(String spiBusPort, Mode ledMode, Direction direction); void write(int[] colors); @Override void close();  }
@Test public void closesSpiDeviceWhenClosing() throws Exception { driver.close(); verify(device).close(); }