### Question:
InMemoryBuildRegistry implements BuildRegistry { @Override public void registerBinary(final Binary binary) { binariesByName.put(binary.getName(), binary); } InMemoryBuildRegistry(); @Override void registerBinary(final Binary binary); @Override List<Binary> getAllBinaries();  }### Answer:
@Test public void registerBinary() { Binary binary = mock(Binary.class); when(binary.getName()).thenReturn(BINARY_NAME); buildRegistry.registerBinary(binary); List<Binary> result = buildRegistry.getAllBinaries(); assertTrue(result.contains(binary)); }