Changing attitudes towards sexism in the workplace is hard enough. What about if the workplace involves rappelling down a wall, covered in mud, while being screamed at by a drill instructor?

A group of behavioral economists, from the Institute for Social Research and University of Oslo, set out to see whether increased diversity in the workforce decreased sexist attitudes and used an interesting example: the Norwegian Armed Forces during boot camp.

At the beginning of training, soldiers were allocated randomly to an all-male or mixed-gendered room. During this period of intense training, soldiers spend a great deal of time working and living with their roommates.

After eight weeks, researchers carried out a survey. Soldiers were presented with a hypothetical application of a candidate applying for the position of squad leader—some were given this application under a female name, while others were given one with a male name. The soldiers were asked to rate the candidate from a scale from 1 to 6.

In general, men ranked female applicant lower than male applicants, but co-author Gaute Torsvik tells Quartz “those who lived and worked with women didn’t discriminate.” They found that some of the biases men entered with simply ”evaporated” after working in mixed platoons.

Torsvik isn’t particularly surprised that living and working together with a female recruit in a squad had an impact on a male soldier’s perception of female leadership. Previous research has shown that random exposure to female village leaders in India or black roommates in college reduced bias against these groups.

But he was still shocked that men from mixed platoons showed no discrimination at all. “We didn’t expect the results to be so strong,” Torsvik says.

Could the results have repercussions for more sedate, white-collar office workplaces, where the glass ceiling persists and some propose female quotas to correct this? In Europe, women still account for less than 12% of board directors (pdf) and things aren’t better in the US, where less than 19% of Fortune 500 boards are women.

Torsvik points out that the soldiers were all working on an even playing field: they had to wear uniforms at all times, performed various tasks together such as cleaning the room for inspection, and were not allowed to sleep outside of the base.

He isn’t sure if they would find similar results in a more competitive environment.