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

		if (subCommand == GET_UNKNOWN_SUB_COMMAND_NAME) {
			returnCommand = getUnknownMember(reader);
		} else if (subCommand == GET_JAVA_LANG_CLASS_SUB_COMMAND_NAME) {
			returnCommand = getJavaLangClass(reader);
		} else {
			returnCommand = getMember(reader);
		}

		logger.finest("Returning command: " + returnCommand);
		writer.write(returnCommand);
		writer.flush();
	}
@Test
	public void testUnknown() {
		String inputCommand1 = ReflectionCommand.GET_UNKNOWN_SUB_COMMAND_NAME + "\n" + "java" + "\nrj\ne\n";
		String inputCommand2 = ReflectionCommand.GET_UNKNOWN_SUB_COMMAND_NAME + "\n" + "java.lang" + "\nrj\ne\n";
		String inputCommand3 = ReflectionCommand.GET_UNKNOWN_SUB_COMMAND_NAME + "\n" + "java.lang.String" + "\nrj\ne\n";
		String inputCommand4 = ReflectionCommand.GET_UNKNOWN_SUB_COMMAND_NAME + "\n" + "p1.Cat" + "\nrj\ne\n";
		String inputCommand5 = ReflectionCommand.GET_UNKNOWN_SUB_COMMAND_NAME + "\n" + "byte" + "\nrj\ne\n";
		String inputCommand6 = ReflectionCommand.GET_UNKNOWN_SUB_COMMAND_NAME + "\n" + "System" + "\nrj\ne\n";
		String inputCommand7 = ReflectionCommand.GET_UNKNOWN_SUB_COMMAND_NAME + "\n" + "File" + "\nrj\ne\n";
		try {
			this.gateway.getDefaultJVMView().addSingleImport("java.util.List");
			this.gateway.getDefaultJVMView().addStarImport("java.io.*");
			command.execute("r", new BufferedReader(new StringReader(inputCommand1)), writer);
			assertEquals("!yp\n", sWriter.toString());
			command.execute("r", new BufferedReader(new StringReader(inputCommand2)), writer);
			assertEquals("!yp\n!yp\n", sWriter.toString());
			command.execute("r", new BufferedReader(new StringReader(inputCommand3)), writer);
			assertEquals("!yp\n!yp\n!ycjava.lang.String\n", sWriter.toString());
			command.execute("r", new BufferedReader(new StringReader(inputCommand4)), writer);
			assertEquals("!yp\n!yp\n!ycjava.lang.String\n!ycp1.Cat\n", sWriter.toString());
			command.execute("r", new BufferedReader(new StringReader(inputCommand5)), writer);
			assertEquals("!yp\n!yp\n!ycjava.lang.String\n!ycp1.Cat\n!ycbyte\n", sWriter.toString());
			command.execute("r", new BufferedReader(new StringReader(inputCommand6)), writer);
			assertEquals("!yp\n!yp\n!ycjava.lang.String\n!ycp1.Cat\n!ycbyte\n!ycjava.lang.System\n",
					sWriter.toString());
			command.execute("r", new BufferedReader(new StringReader(inputCommand7)), writer);
			assertEquals(
					"!yp\n!yp\n!ycjava.lang.String\n!ycp1" + ".Cat\n!ycbyte\n!ycjava.lang.System\n!ycjava.io.File\n",
					sWriter.toString());

		} catch (Exception e) {
			e.printStackTrace();
			fail();
		}
	}