Java - Write code to convert Y to Boolean

Requirements

Write code to convert Y to Boolean

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String str = "book2s.com";
        System.out.println(toBoolean(str));
    }/*from   w  ww.  ja v  a 2s . c  om*/

    public static boolean toBoolean(String str) {
        return str.equalsIgnoreCase("Y");
    }
}