Utils { protected static byte[] intToByteArray(int value) { return new byte[] { (byte) (value >>> 24), (byte) (value >>> 16), (byte) (value >>> 8), (byte) value }; }  @SuppressWarnings("unchecked") static Object constructRefs(Bridge bridge, Map<String, Object> theMap); static boolean isRemoteObject(Class<?> klass); static Class<?> autobox(Class<?> klass); static Object defaultValueForPrimitive(Class<?> primitive); static final String DEFAULT_REDIRECTOR; static final BridgeEventHandler DEFAULT_EVENT_HANDLER; static final boolean DEFAULT_RECONNECT; static final String DEFAULT_SECURE_REDIRECTOR; static int logLevel; }
@Test public void testIntToByteArray() { byte[] posBytes = new byte[] { 0x00, 0x00, 0x00, 0x2a }; assertArrayEquals(posBytes, Utils.intToByteArray(42)); byte[] zeroBytes = new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 }; assertArrayEquals(zeroBytes, Utils.intToByteArray(0)); byte[] negBytes = new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xf4 }; assertArrayEquals(negBytes, Utils.intToByteArray(-12)); }