Here you can find the source of equals(final CharSequence cs1, final CharSequence cs2)
public static boolean equals(final CharSequence cs1, final CharSequence cs2)
//package com.java2s; public class Main { public static boolean equals(final CharSequence cs1, final CharSequence cs2) { if (cs1 == cs2) { return true; }// ww w . j av a 2 s .c o m if (cs1 == null || cs2 == null) { return false; } return cs1.toString().equals(cs2.toString()); } }