LiteralUtils { public static String trimLongSuffix(String longString) { if (StringUtils.isBlank(longString)) { return longString; } int lastCharPosition = longString.length() - 1; char lastChar = longString.charAt(lastCharPosition); String value = longString; if (lastChar == 'L' || lastChar == 'l') { value = longString.substring(0, lastCharPosition); } return value; } private  LiteralUtils(); @CheckForNull static Integer intLiteralValue(ExpressionTree expression); @CheckForNull static Long longLiteralValue(ExpressionTree tree); static boolean isEmptyString(Tree tree); static boolean is0xff(ExpressionTree expression); static String trimQuotes(String value); static boolean isTextBlock(String value); static String trimLongSuffix(String longString); static boolean hasValue(Tree tree, String expectedValue); static boolean isTrue(Tree tree); static boolean isFalse(Tree tree); static boolean isZero(ExpressionTree tree); static boolean isOne(ExpressionTree tree); static boolean isNegOne(ExpressionTree tree);  }
@Test void testTrimLongSuffix() throws Exception { assertThat(LiteralUtils.trimLongSuffix("")).isEmpty(); String longValue = "12345"; assertThat(LiteralUtils.trimLongSuffix(longValue)).isEqualTo(longValue); assertThat(LiteralUtils.trimLongSuffix(longValue + "l")).isEqualTo(longValue); assertThat(LiteralUtils.trimLongSuffix(longValue + "L")).isEqualTo(longValue); }