public void delete(int id) {
        if (!bookMap.containsKey(id)) {
            throw new RuntimeException("Book id not exist");
        }
        bookList.remove(bookMap.get(id));
        bookMap.remove(id);
    }
public void delete ( int id ) { if ( ! bookMap . containsKey ( id ) ) { throw new RuntimeException ( "Book id not exist" ) ; } bookList . remove ( bookMap . get ( id ) ) ; bookMap . remove ( id ) ; }
delete