@Test public void test() { // Insert 25, 100, 10 try { tMachine.getCoinSlot().addCoin(new Coin(25)); tMachine.getCoinSlot().addCoin(new Coin(100)); tMachine.getCoinSlot().addCoin(new Coin(10)); } catch (DisabledException e) { e.printStackTrace(); } // Press selection button zero tMachine.getSelectionButton(0).press(); // Compare the extraction with expected results List<Object> extractedItems = Arrays.asList(tMachine.getDeliveryChute().removeItems()); Object[] actualExtractedItems = TestUtilities.parseExtraction(extractedItems); Object[] expectedExtraction = {0, "stuff"}; assertArrayEquals(expectedExtraction, actualExtractedItems); // Compare vending machine stored contents with expected output Object[] actualContents = TestUtilities.parseContents(TestUtilities.emptyContents(tMachine)); Object[] expectedContents = {1400, 135}; assertArrayEquals(expectedContents, actualContents); }