@Test
public void testReadHardwareVersion() {

    doAnswer(new Answer() {
        public Object answer(InvocationOnMock invocation) {
            Object[] args = invocation.getArguments();
            hwVersionCallback = (DeviceProfile.VersionCallback) args[0];
            return null;
        }
    }).when(mockDeviceProfile).getHardwareVersion(any(DeviceProfile.VersionCallback.class));
    bean.readHardwareVersion(new Callback<String>() {
        @Override
        public void onResult(String result) {
            assertThat(result).isEqualTo("hwfoo");
        }
    });
    hwVersionCallback.onComplete("hwfoo");
}