RobotProjectConfigReader { public RobotProjectConfigWithLines readConfigurationWithLines(final InputStream contents) { try (Reader reader = new InputStreamReader(contents, StandardCharsets.UTF_8)) { return readConfigurationWithLines(reader); } catch (final IOException e) { throw new CannotReadProjectConfigurationException( "Project configuration file '" + RobotProjectConfig.FILENAME + "' cannot be read", e); } }  RobotProjectConfig readConfiguration(final InputStream contents); RobotProjectConfigWithLines readConfigurationWithLines(final InputStream contents);  }
@Test public void testIfConfigurationWithLinesIsRead_whenDefaultCharsetIsDifferentThanUTF8() throws Exception { final RobotProjectConfig writeConfig = new RobotProjectConfig(); writeConfig.setVariableMappings(Arrays.asList(MAPPING_WITH_SPECIAL_CHARS)); final InputStream stream = writer.writeConfiguration(writeConfig); final RobotProjectConfigWithLines readConfig = reader.readConfigurationWithLines(stream); assertThat(readConfig.getConfigurationModel().getVariableMappings()).containsOnly(MAPPING_WITH_SPECIAL_CHARS); }