@Test
public void testEvaluateHelpWithNoSuchCommandUsage() throws Exception {

    final Configuration configuration = new Configuration();
    final SessionState sessionState = mock(SessionState.class);
    when(sessionState.configuration()).thenReturn(configuration);
    final HadoopREPL repl = new HadoopREPL(configuration, sessionState);
    doAnswer(new Answer() {
        @Override
        public Object answer(final InvocationOnMock invocationOnMock) throws Throwable {
            assertEquals("Unknown command \"test\"", String.format(invocationOnMock.getArguments()[0].toString(), invocationOnMock.getArguments()[1]));
            return null;
        }
    }).when(sessionState).error(anyString());
    repl.evaluate("help test");
    assertEquals("help test", Iterables.get(repl.history(), 0));
}