SAN JOSE — Freshman Donald Williams Jr. was looking forward in 2013 to sharing a dormitory suite at San Jose State with seven likeminded engineering students. Instead, Williams told a jury Monday, he found himself the target of racial bullying that made him feel like “less than a human being.”

In his first public comments since Santa Clara County prosecutors charged three of his suitemates with battery and a hate crime for acts that included clamping a U-shaped bike lock around his neck, Williams said the harassment left him feeling demeaned and demoralized.

“I felt like I was locked up, a slave,” he said. “Being African-American, it felt like I was being ridiculed, like my culture was being made fun of.”

Logan Beaschler and Colin Warren, now 20, and Joseph “Bret” Bomgardner, 21, all have pleaded not guilty to misdemeanor battery and hate crime charges, which carry penalties ranging from community service and weekend work up to a year in county jail.

Lawyers for the three former San Jose State students painted their clients’ conduct as merely part of a “prank war gone too far.” Chuck Mesirow, who represents Beaschler, told the jury his client was not motivated by bigotry.

“I hope you will see this for what it was — childish, immature and insensitive, but not racist,” Mesirow said.

But prosecutor Carolyn Malinsky scoffed in her opening statement at the notion that the young men were just engaged in high jinks against the only black student living in the eight-man dormitory suite during the fall 2013 semester.

“Don Williams Jr. became a target for harassment, for abuse, for physical attacks by his own suitemates because he was different … because of his race,” she told the jury. “What happened to D.J. was wrong, and we’re here to hold the defendants accountable.”

The three men are accused of subjecting Williams, who was 17 at the time, to repeated abuse, including calling him racially derogatory names, locking him in his room and bathroom, trying to lock him in a closet, and displaying a Confederate flag. A fourth student was also charged, but the outcome of his case remains sealed because he was under the age of 18 at the time.

Lawyers for the defendants beseeched the jury to examine the roles of each of their clients separately, arguing they were involved only to varying degrees.

“If this was a 2½-hour movie, you’d find (Bomgardner) in just one scene,” said Bomgardner’s lawyer, Sam Polverino.

Williams, whose family lives in Santa Cruz, testified that the atmosphere of the four-bedroom suite quickly soured.

It started when Warren, Logan and a female visitor began coming up with innocuous nicknames for one another like “Boat Shoes” and “Blue Peeps.” But in his case, the group dubbed Williams “Three-fifths,” a racially loaded term referring to the way the United States once counted blacks as just a fraction of a person. When he protested, they dubbed him “Fraction.”

“I was actually very sad,” the lanky, soft-spoken young man dressed in a navy blazer and argyle sweater said in response to a question from the prosecutor. “To be called less than a human being — I told them, ‘Don’t call me that.'”

Then there was the time he went into the room of one of his suitemates to talk about a class they were taking, only to get jumped by some of his suitemates, including Beaschler, Warren and the juvenile, who wrestled him to the ground and thrust the U-shaped bike lock onto his neck, Williams said. Shown the black lock by the prosecutor, he teared up and wiped at his eyes.

“It was a little tight,” he said in a choked voice. “Everyone was laughing.”

Williams said he told them it wasn’t funny and not to do it again. But sometime later during the semester, he was jumped again by a group that he said included Bomgardner. He fought them off, but his lip got cut in the process.

Other indignities included coming home to find a large red Confederate flag tacked to the living room wall and, later, a racial slur written on a whiteboard. The flag was taken down when he objected but later reappeared draped around a cardboard cutout meant to resemble the late daredevil motorcyclist Evel Knievel.

In contrast, lawyers for the three men contended that Williams laughed off the incidents, telling the men he’d get them next time, which Williams denied Monday. Pranks were all the rage in the dorm, ranging from putting Vaseline on doorknobs to stealing fish, the lawyers said. Williams wasn’t the only one barricaded in a room, for instance; so were Warren and Beaschler.

The bike lock incident did not happen to anyone else in the suite, but was not racially tinged bullying, said Dek Ketchum, Warren’s lawyer. The men got the idea from the Comedy Central TV series “Workaholics,” in which two white co-workers get a third white colleague drunk and put a bike lock around his neck.

Ketchum also said that Warren dated an African-American student early in the semester.

“It’s clear these pranks are political satire,” he said.

Beaschler’s attorney, Mesirow, also painted a benign picture of his client, stressing he was brought up by liberal Democrats and played sports with heavily Latino and black teams. He explained Beaschler’s display of the Confederate flag, saying his client is “fascinated with historical relics” and is a libertarian who supports states’ rights. The racial slur he wrote on the whiteboard was a play on a rap song, Mesirow said.

“He has an edgy, dark sense of humor,” he said, “and it would bother a few people.”

After the hate crime charges were filed in November 2013, the allegation that the freshman had been tormented for weeks sparked protest marches, an internal investigation by the college, an apology from the college president and the creation of a task force on campus race relations.

Beaschler, Warren and the juvenile were expelled from the university and banned for life from enrolling in any California State University college. Bomgardner was suspended from San Jose State but has not re-enrolled this year, according to a university spokeswoman.

Contact Tracey Kaplan at 408-278-3482. Follow her at Twitter.com/tkaplanreport.