@Test public void shouldReturnNullIfNoLevelWithKeyFound() { InMemoryParameter parameter = new InMemoryParameter(); InMemoryLevel foundLevel = parameter.findLevel(new InMemoryLevelKey()); assertThat(foundLevel).isNull(); }
InMemoryLevel findLevel(InMemoryLevelKey levelKey) { InMemoryLevel inMemoryLevel; for (Level level : levels) { inMemoryLevel = (InMemoryLevel) level; if (inMemoryLevel.getKey().value().equals(levelKey.value())) { return inMemoryLevel; } } return null; }
InMemoryParameter implements Parameter { InMemoryLevel findLevel(InMemoryLevelKey levelKey) { InMemoryLevel inMemoryLevel; for (Level level : levels) { inMemoryLevel = (InMemoryLevel) level; if (inMemoryLevel.getKey().value().equals(levelKey.value())) { return inMemoryLevel; } } return null; } }
InMemoryParameter implements Parameter { InMemoryLevel findLevel(InMemoryLevelKey levelKey) { InMemoryLevel inMemoryLevel; for (Level level : levels) { inMemoryLevel = (InMemoryLevel) level; if (inMemoryLevel.getKey().value().equals(levelKey.value())) { return inMemoryLevel; } } return null; } InMemoryParameter();   InMemoryParameter(Parameter parameter); }
InMemoryParameter implements Parameter { InMemoryLevel findLevel(InMemoryLevelKey levelKey) { InMemoryLevel inMemoryLevel; for (Level level : levels) { inMemoryLevel = (InMemoryLevel) level; if (inMemoryLevel.getKey().value().equals(levelKey.value())) { return inMemoryLevel; } } return null; } InMemoryParameter();   InMemoryParameter(Parameter parameter); @Override ParameterKey getKey(); @Override String getName(); @Override List<Level> getLevels(); @Override int getInputLevels(); @Override Set<ParameterEntry> getEntries(); @Override boolean isCacheable(); @Override boolean isNullable(); @Override char getArraySeparator(); @Override boolean isIdentifyEntries(); }
InMemoryParameter implements Parameter { InMemoryLevel findLevel(InMemoryLevelKey levelKey) { InMemoryLevel inMemoryLevel; for (Level level : levels) { inMemoryLevel = (InMemoryLevel) level; if (inMemoryLevel.getKey().value().equals(levelKey.value())) { return inMemoryLevel; } } return null; } InMemoryParameter();   InMemoryParameter(Parameter parameter); @Override ParameterKey getKey(); @Override String getName(); @Override List<Level> getLevels(); @Override int getInputLevels(); @Override Set<ParameterEntry> getEntries(); @Override boolean isCacheable(); @Override boolean isNullable(); @Override char getArraySeparator(); @Override boolean isIdentifyEntries();  }