public static void main(String args[]){
        FirstOccurrenceOfNumberInSortedArray fos = new FirstOccurrenceOfNumberInSortedArray();
        int input[] = {1,2,2,2,2,2,5,7,7};
        System.out.println(fos.firstOccurrence(input, 6));
    }
http://www.geeksforgeeks.org/check-for-majority-element-in-a-sorted-array/
src/com/interview/binarysearch/FirstOccurrenceOfNumberInSortedArray.java