public static boolean isBase64IgnoreTrailingPeriods(byte[] arrayOctet) {
    int i = arrayOctet.length - 1;
    while (i >= 0 && '.' == arrayOctet[i]) {
      --i;
    }
    while (i >= 0) {
      if (!isBase64(arrayOctet[i])) {
        return false;
      }
      --i;
    }
    return true;
  }
@Test
  public void testBase64IgnoreTrailingPeriods() {
    for (final String s : BASE64_STRINGS) {
      String testStr = s;
      for (int i = 0; i < 10; i++) {
        assertTrue(Base64Utils.isBase64IgnoreTrailingPeriods(testStr.getBytes(StandardCharsets.UTF_8)));
        testStr = testStr + ".";
      }
    }

    for (final String s : BASE64_STRINGS_WITH_WHITE_SPACE) {
      String testStr = s;
      for (int i = 0; i < 2; i++) {
        assertFalse(Base64Utils.isBase64IgnoreTrailingPeriods(testStr.getBytes(StandardCharsets.UTF_8)));
        testStr = testStr + ".";
      }
    }

    for (final String s : NON_BASE64_STRINGS) {
      String testStr = s;
      for (int i = 0; i < 2; i++) {
        assertFalse(Base64Utils.isBase64IgnoreTrailingPeriods(testStr.getBytes(StandardCharsets.UTF_8)));
        testStr = testStr + ".";
      }
    }
  }