ResponseUtils { public static boolean contains(final byte[] pByte, final SwEnum... pEnum) { SwEnum val = SwEnum.getSW(pByte); if (LOGGER.isDebugEnabled() && pByte != null) { LOGGER.debug("Response Status <" + BytesUtils.bytesToStringNoSpace(Arrays.copyOfRange(pByte, Math.max(pByte.length - 2, 0), pByte.length)) + "> : " + (val != null ? val.getDetail() : "Unknow")); } return val != null && ArrayUtils.contains(pEnum, val); } private  ResponseUtils(); static boolean isSucceed(final byte[] pByte); static boolean isEquals(final byte[] pByte, final SwEnum pEnum); static boolean contains(final byte[] pByte, final SwEnum... pEnum);  }
@Test public void testResponseContains() { Assertions.assertThat(ResponseUtils.contains(new byte[] { (byte) 0x90, 0 }, SwEnum.SW_6D, SwEnum.SW_9000)).isEqualTo(true); Assertions.assertThat(ResponseUtils.contains(new byte[] { (byte) 0x6D, 18 }, SwEnum.SW_6D, SwEnum.SW_9000)).isEqualTo(true); Assertions.assertThat(ResponseUtils.contains(new byte[] { (byte) 0x00, 0 }, SwEnum.SW_6D, SwEnum.SW_9000)).isEqualTo(false); Assertions.assertThat(ResponseUtils.contains(null, SwEnum.SW_6D)).isEqualTo(false); }