@Override
	public void execute(String commandName, BufferedReader reader, BufferedWriter writer)
			throws Py4JException, IOException {
		String returnCommand = null;
		String subCommand = safeReadLine(reader, false);

		if (subCommand.equals(HELP_OBJECT_SUB_COMMAND_NAME)) {
			returnCommand = getHelpObject(reader);
		} else if (subCommand.equals(HELP_CLASS_SUB_COMMAND_NAME)) {
			returnCommand = getHelpClass(reader);
		} else {
			returnCommand = Protocol.getOutputErrorCommand("Unknown Help SubCommand Name: " + subCommand);
		}
		logger.finest("Returning command: " + returnCommand);
		writer.write(returnCommand);
		writer.flush();
	}
@Test
	public void testHelpClassPattern() {
		String inputCommand = "c\n" + ExampleClass.class.getName() + "\nsm*\ntrue\ne\n";
		try {
			assertTrue(gateway.getBindings().containsKey(target));
			command.execute("h", new BufferedReader(new StringReader(inputCommand)), writer);
			String page = sWriter.toString();
			System.out.println(page);
			assertTrue(page.length() > 1);
			assertTrue(page.contains("method1"));
			assertTrue(!page.contains("getField1"));
		} catch (Exception e) {
			e.printStackTrace();
			fail();
		}
	}