@Test public void testIsHex() { TelegesisFrame frame = new TelegesisFrame(); List<Integer> allowed = Arrays.asList(new Integer[] { (int) '0', (int) '1', (int) '2', (int) '3', (int) '4', (int) '5', (int) '6', (int) '7', (int) '8', (int) '9', (int) 'A', (int) 'B', (int) 'C', (int) 'D', (int) 'E', (int) 'F', (int) 'a', (int) 'b', (int) 'c', (int) 'd', (int) 'e', (int) 'f' }); Method isHex; try { isHex = TelegesisFrame.class.getDeclaredMethod("isHex", new Class[] { int.class }); isHex.setAccessible(true); for (int value = 0; value < 256; value++) { assertEquals(allowed.contains(value), (boolean) isHex.invoke(frame, value)); } } catch (NoSuchMethodException | SecurityException | IllegalArgumentException | IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); } }
private boolean isHex(int value) { return ((value >= 0x30 && value <= 0x39) || (value >= 0x41 && value <= 0x46) || (value >= 0x61 && value <= 0x66)); }
TelegesisFrame { private boolean isHex(int value) { return ((value >= 0x30 && value <= 0x39) || (value >= 0x41 && value <= 0x46) || (value >= 0x61 && value <= 0x66)); } }
TelegesisFrame { private boolean isHex(int value) { return ((value >= 0x30 && value <= 0x39) || (value >= 0x41 && value <= 0x46) || (value >= 0x61 && value <= 0x66)); }  }
TelegesisFrame { private boolean isHex(int value) { return ((value >= 0x30 && value <= 0x39) || (value >= 0x41 && value <= 0x46) || (value >= 0x61 && value <= 0x66)); }  TelegesisStatusCode getStatus(); }
TelegesisFrame { private boolean isHex(int value) { return ((value >= 0x30 && value <= 0x39) || (value >= 0x41 && value <= 0x46) || (value >= 0x61 && value <= 0x66)); }  TelegesisStatusCode getStatus();  }