Short answer
Replacing line 172 in mbwk.cls,
\exhyphenpenalty=10000
by
\exhyphenpenalty=9999
does the trick.
More detailed answer
The mwbk.cls class, which is loaded internally by the class you use (mgraph), sets, at lines 171-172,
\hyphenpenalty=100
\exhyphenpenalty=10000
Contrast these values to those used by Plain TeX (and by the LaTeX kernel):
\hyphenpenalty=50
\exhyphenpenalty=50
What are those macros used for? Here is a relevant passage from the TeXbook (bottom of page 96, chapter 14):
Each potential breakpoint has an associated “penalty,” which represents the “aesthetic cost” of breaking at that place. [...] Plain TeX sets \hyphenpenalty=50
and \exhyphenpenalty=50.
Exercise 14.6...
Explain how you could instruct TeX not to make any breaks after explicit hyphens and dashes. (This is useful in lengthy bibliographies.)
and its solution...
\exhyphenpenalty=10000 prohibits all such breaks, according to the rules found later in this chapter. Similarly, \hyphenpenalty=10000 prevents breaks after implicit (discretionary) hyphens.
... are also relevant.
Apparently, the author of those classes (mwbk and mgraph) wanted, by setting \exhyphenpenalty to such a high value (10000 is considered by TeX as infinitely bad), to prevent any breaks after explicit hyphens and dashes.
However, this also seems to prevent line breaking in listings. In fact, simply decrementing the \exhyphenpenalty value by one on line 172 in mwbk.cls
\exhyphenpenalty=9999
seems to solve the problem.

\documentclass{templates/mgragh}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\lstset{
frame=single,
breaklines=true,
}
\begin{document}
\begin{lstlisting}
public void createVoiceComment(File recodedFile) throws CommentNotAddedException;
\end{lstlisting}
\end{document}