added endsWith in Java api