FYI, a workaround that works:
# Inline::Java is initialized elsewere, here it is used for a second
time, should be already connected to a shared JVM.
use Inline Java => <<END_OF_JAVA_CODE;
public class StringWrapper implements CharSequence {
private final String string;
public StringWrapper(String string) { this.string = string; }
public char charAt(int index) { return string.charAt(index); }
public int length() { return string.length(); }
public CharSequence subSequence(int start, int end) { return
string.subSequence(start, end); }
public String toString() { return string; }
}
END_OF_JAVA_CODE
my $wrapper = new your_current_package::StringWrapper('bar');
my $got = $javaObject->charSequenceMethod($wrapper);