method2testcases
stringlengths
118
3.08k
### Question: LicenseResolver { public static License read(final String license) { final String trimmedLicense = license.trim(); if (sLicenses.containsKey(trimmedLicense)) { return sLicenses.get(trimmedLicense); } else { throw new IllegalStateException(String.format("no such license available: %s, did you forget to reg...
### Question: XPathRecordReader { public synchronized XPathRecordReader addField(String name, String xpath, boolean multiValued) { addField0(xpath, name, multiValued, false, 0); return this; } XPathRecordReader(String forEachXpath); synchronized XPathRecordReader addField(String name, String xpath, boolean multiValued)...
### Question: EvaluatorBag { public static Evaluator getSqlEscapingEvaluator() { return new Evaluator() { public String evaluate(String expression, Context context) { List l = parseParams(expression, context.getVariableResolver()); if (l.size() != 1) { throw new DataImportHandlerException(SEVERE, "'escapeSql' must have...
### Question: EvaluatorBag { public static Evaluator getUrlEvaluator() { return new Evaluator() { public String evaluate(String expression, Context context) { List l = parseParams(expression, context.getVariableResolver()); if (l.size() != 1) { throw new DataImportHandlerException(SEVERE, "'encodeUrl' must have at leas...
### Question: DocBuilder { @SuppressWarnings("unchecked") static Class loadClass(String name, SolrCore core) throws ClassNotFoundException { try { return core != null ? core.getResourceLoader().findClass(name) : Class.forName(name); } catch (Exception e) { try { String n = DocBuilder.class.getPackage().getName() + "." ...
### Question: EntityProcessorBase extends EntityProcessor { public void init(Context context) { rowIterator = null; this.context = context; if (isFirstInit) { firstInit(context); } query = null; } void init(Context context); Map<String, Object> nextModifiedRowKey(); Map<String, Object> nextDeletedRowKey(); Map<String,...
### Question: MetaLocale implements CLDR.Locale, Comparable<MetaLocale> { private int compare(String a, String b) { if (a != null && b != null) { return a.compareTo(b); } if (a == null) { if (b == null) { return 0; } return -1; } return 1; } MetaLocale(); MetaLocale(String language, String script, String territory, St...
### Question: MetaLocale implements CLDR.Locale, Comparable<MetaLocale> { @Override public boolean equals(Object obj) { if (obj instanceof MetaLocale) { MetaLocale other = (MetaLocale) obj; return Arrays.equals(fields, other.fields); } return false; } MetaLocale(); MetaLocale(String language, String script, String ter...
### Question: UnitFactorMap { public UnitCategory getUnitCategory() { return category; } UnitFactorMap(UnitCategory category); private UnitFactorMap(UnitCategory category, Map<Unit, Map<Unit, UnitFactor>> factors); UnitCategory getUnitCategory(); UnitValue convert(UnitValue value, Unit to); UnitValue convert(UnitValue...
### Question: UnitFactorMap { public void sortUnits(Unit[] units) { Arrays.sort(units, (a, b) -> { Integer ia = unitOrder.get(a); Integer ib = unitOrder.get(b); if (ia == null) { return 1; } if (ib == null) { return -1; } return Integer.compare(ia, ib); }); } UnitFactorMap(UnitCategory category); private UnitFactorMap...
### Question: UnitFactorMap { public String dump(Unit unit) { StringBuilder buf = new StringBuilder(); buf.append(unit).append(":\n"); Map<Unit, UnitFactor> map = factors.get(unit); for (Unit base : map.keySet()) { UnitFactor factor = map.get(base); buf.append(" ").append(factor).append(" "); buf.append(factor.rational...
### Question: UnitFactorSet { public List<UnitValue> factors() { return factors; } UnitFactorSet(Unit base, UnitFactorMap factorMap, Unit...units); UnitFactorSet(UnitFactorMap factorMap, Unit...units); private UnitFactorSet(Unit unitBase, boolean forceBase, UnitFactorMap factorMap, Unit...units); Unit base(); List<Un...
### Question: DigitBuffer implements CharSequence { @Override public DigitBuffer subSequence(int start, int end) { start = clamp(start, 0, size - 1); end = clamp(end, start, size - 1); int sz = end - start; char[] newbuf = new char[16 + sz]; System.arraycopy(buf, start, newbuf, 0, sz); return new DigitBuffer(newbuf, sz...
### Question: NumberFormattingUtils { public static int integerDigits(BigDecimal n) { return n.precision() - n.scale(); } static int integerDigits(BigDecimal n); static BigDecimal setup( BigDecimal n, // number to be formatted NumberRoundMode roundMode, // rounding mode Num...
### Question: MetaLocale implements CLDR.Locale, Comparable<MetaLocale> { public String variant() { return getField(VARIANT, ""); } MetaLocale(); MetaLocale(String language, String script, String territory, String variant); protected MetaLocale(MetaLocale other); String language(); String script(); String territory()...
### Question: NumberPattern { public Format format() { return format == null ? DEFAULT_FORMAT : format; } protected NumberPattern(String pattern, List<Node> parsed, Format format); String pattern(); List<Node> parsed(); Format format(); String render(); @Override boolean equals(Object obj); @Override String toString()...
### Question: LanguageMatcher { public Match match(String desiredRaw) { return matchImpl(parse(desiredRaw), DEFAULT_THRESHOLD); } LanguageMatcher(String supportedLocales); LanguageMatcher(List<String> supportedLocales); Match match(String desiredRaw); Match match(String desiredRaw, int threshold); Match match(List<Str...
### Question: FileInfosPresenter implements FileInfosContract.Presenter { @Override public void loadFileInfos() { mFileInfosRepository .listFileInfos(mDirectory) .observeOn(mSchedulerProvider.ui()) .subscribe(new Action1<List<FileInfo>>() { @Override public void call(List<FileInfo> fileInfos) { if (fileInfos.isEmpty())...
### Question: UserServiceImpl implements UserService { @Override public void create(User user) { User existing = userRepository.findByUsername(user.getUsername()); Assert.isNull(existing, "user already exist: " + user.getUsername()); String hash = encoder.encode(user.getPassword()); user.setPassword(hash); user.setEnab...
### Question: MysqlUserDetailsService implements UserDetailsService { @Override public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException { User user = userRepository.findByUsername(s); log.info("user is found! -> " + user.getUsername()); if (user == null) { log.info("user is not found!"); throw ...
### Question: AccountServiceImpl implements AccountService { @Override public Account findByUserName(String username) { Assert.hasLength(username); return repository.findByUsername(username); } @Override Account findByUserName(String username); @Override Account findByEmail(String email); @Override Account create(User...
### Question: AccountServiceImpl implements AccountService { @Override public Account findByEmail(String email) { Assert.hasLength(email); return repository.findByEmail(email); } @Override Account findByUserName(String username); @Override Account findByEmail(String email); @Override Account create(User user); @Overri...
### Question: BigFontGenerator { public String convert(String text, int position) { HashMap<Character, String> hashMap = fonts.get(position); ArrayList<String> chars = new ArrayList<>(); for (int i = 0; i < text.length(); i++) { String s = hashMap.get(Character.toUpperCase(text.charAt(i))); if (s == null) { throw new U...
### Question: Main { public static void main(String[] args) throws Exception { if (args.length > 0 && args[0].equals("-Xjdb")) { String[] newargs = new String[args.length + 2]; Class<?> c = Class.forName("com.sun.tools.example.debug.tty.TTY"); Method method = c.getDeclaredMethod("main", new Class<?>[] { args.getClass()...
### Question: Launcher { public static void main(String... args) { JavaCompiler javac = ToolProvider.getSystemJavaCompiler(); JFileChooser fileChooser; Preferences prefs = Preferences.userNodeForPackage(Launcher.class); if (args.length > 0) fileChooser = new JFileChooser(args[0]); else { String fileName = prefs.get("re...
### Question: Main { public static int compile(String[] args) { com.sun.tools.javac.main.Main compiler = new com.sun.tools.javac.main.Main("javac"); return compiler.compile(args); } static void main(String[] args); static int compile(String[] args); static int compile(String[] args, PrintWriter out); }### Answer: @Te...
### Question: Parser { public MavenRepositoryURL getRepositoryURL() { return m_repositoryURL; } Parser( final String path ); MavenRepositoryURL getRepositoryURL(); String getGroup(); String getArtifact(); String getVersion(); String getType(); String getClassifier(); String getArtifactPath(); String getArtifactPath( fi...
### Question: Parser { public String getResourceName() { return m_resourceName; } Parser( final String path ); String getResourceName(); }### Answer: @Test public void getResourceNameWithContainingSlash() throws MalformedURLException { assertEquals( "Resource name", "somewhere/resource", new Parser( "somewhere/resourc...
### Question: AbstractConnection extends URLConnection { protected static boolean checkJarIsLegal(String name) { boolean isMatched = false; for (Pattern pattern : blacklist) { isMatched = pattern.matcher(name).find(); if (isMatched) { break; } } return !isMatched; } protected AbstractConnection( final URL url, ...
### Question: Parser { public URL getWrappedJarURL() { return m_wrappedJarURL; } Parser( final String path, final boolean certificateCheck ); URL getWrappedJarURL(); Properties getWrappingProperties(); OverwriteMode getOverwriteMode(); }### Answer: @Test public void validWrappedJarURL() throws MalformedURLException { ...
### Question: ConfigurationImpl extends PropertyStore implements Configuration { public Boolean getCertificateCheck() { if( !contains( ServiceConstants.PROPERTY_CERTIFICATE_CHECK ) ) { return set( ServiceConstants.PROPERTY_CERTIFICATE_CHECK, Boolean.valueOf( m_propertyResolver.get( ServiceConstants.PROPERTY_CERTIFICATE...
### Question: Connection extends URLConnection { @Override public InputStream getInputStream() throws IOException { return new BundleBuilder( m_parser.getOptions(), new ResourceWriter( new FileTailImpl( m_parser.getDirectory(), m_parser.getTailExpr() ) .getParentOfTail() ) ).build(); } Connection( URL url, Configuratio...
### Question: Parser { public File getDirectory() { return m_directory; } Parser( String url ); File getDirectory(); Properties getOptions(); String getTailExpr(); }### Answer: @Test public void parseValidURL() throws IOException { File f = new File( System.getProperty( "java.io.tmpdir" ) ); assertEquals( f.getCanonic...
### Question: Parser { public Properties getOptions() { return m_options; } Parser( String url ); File getDirectory(); Properties getOptions(); String getTailExpr(); }### Answer: @Test public void parseWithMoreParams() throws IOException, URISyntaxException { Parser parser = new Parser( "http:." + "$a=1&b=2" ); assert...
### Question: Parser { public String getSnapshotPath( final String version, final String timestamp, final String buildnumber ) { return new StringBuilder() .append( m_group.replaceAll( GROUP_SEPARATOR, FILE_SEPARATOR ) ) .append( FILE_SEPARATOR ) .append( m_artifact ) .append( FILE_SEPARATOR ) .append( version ) .appen...
### Question: Parser { public String getArtifactPath() { return getArtifactPath( m_version ); } Parser( final String path ); MavenRepositoryURL getRepositoryURL(); String getGroup(); String getArtifact(); String getVersion(); String getType(); String getClassifier(); String getArtifactPath(); String getArtifactPath( fi...
### Question: Parser { public String getVersionMetadataPath( final String version ) { return new StringBuilder() .append( m_group.replaceAll( GROUP_SEPARATOR, FILE_SEPARATOR ) ) .append( FILE_SEPARATOR ) .append( m_artifact ) .append( FILE_SEPARATOR ) .append( version ) .append( FILE_SEPARATOR ) .append( METADATA_FILE ...
### Question: Parser { public String getArtifactMetdataPath() { return new StringBuilder() .append( m_group.replaceAll( GROUP_SEPARATOR, FILE_SEPARATOR ) ) .append( FILE_SEPARATOR ) .append( m_artifact ) .append( FILE_SEPARATOR ) .append( METADATA_FILE ) .toString(); } Parser( final String path ); MavenRepositoryURL ge...
### Question: Parser { public String getArtifactLocalMetdataPath() { return new StringBuilder() .append( m_group.replaceAll( GROUP_SEPARATOR, FILE_SEPARATOR ) ) .append( FILE_SEPARATOR ) .append( m_artifact ) .append( FILE_SEPARATOR ) .append( METADATA_FILE_LOCAL ) .toString(); } Parser( final String path ); MavenRepos...
### Question: Connection extends URLConnection { public InputStream getInputStream() throws IOException { connect(); InputStream is; if( url.getAuthority() != null ) { is = getFromSpecificBundle(); } else { is = getFromClasspath(); if( is == null ) { is = getFromInstalledBundles(); } } if( is == null ) { throw new IOEx...
### Question: RelevanceModel { public static Dataset concat(Dataset d1, Dataset d2) { double[][] X = concat(d1.getX(), d2.getX()); double[] y = concat(d1.getY(), d2.getY()); return new Dataset(X, y); } static void main(String[] args); static Dataset concat(Dataset d1, Dataset d2); static double[] concat(double[] y1, d...
### Question: NerGroup { public static List<String> groupNer(List<Word> tokens) { if (tokens.isEmpty()) { return Collections.emptyList(); } String prevNer = "O"; List<List<Word>> groups = new ArrayList<>(); List<Word> group = new ArrayList<>(); for (Word w : tokens) { String ner = w.getNer(); if (prevNer.equals(ner) &&...
### Question: DefaultJavaRunner implements StoppableJavaRunner { static String getJavaExecutable( final String javaHome ) throws PlatformException { if( javaHome == null ) { throw new PlatformException( "JAVA_HOME is not set." ); } return javaHome + "/bin/java"; } DefaultJavaRunner(); DefaultJavaRunner( boolean wait )...
### Question: ConciergePlatformBuilder implements PlatformBuilder { public String[] getArguments( final PlatformContext context ) { return null; } ConciergePlatformBuilder( final BundleContext bundleContext, final String version ); void prepare( final PlatformContext context ); String getMainClassName(); String[] getAr...
### Question: KnopflerfishPlatformBuilderF300 implements PlatformBuilder { public String getMainClassName() { return MAIN_CLASS_NAME; } KnopflerfishPlatformBuilderF300( final BundleContext bundleContext, final String version ); void prepare( final PlatformContext context ); String getMainClassName(); String[] getArgume...
### Question: KnopflerfishPlatformBuilderF300 implements PlatformBuilder { public String getRequiredProfile( final PlatformContext context ) { final Boolean console = context.getConfiguration().startConsole(); if( console == null || !console ) { return null; } else { return CONSOLE_PROFILE; } } KnopflerfishPlatformBuil...
### Question: KnopflerfishPlatformBuilderF300 implements PlatformBuilder { public String[] getArguments( final PlatformContext context ) { NullArgumentException.validateNotNull( context, "Platform context" ); return new String[]{ "-xargs", context.getFilePathStrategy().normalizeAsUrl( new File( new File( context.getWor...
### Question: KnopflerfishPlatformBuilderF300 implements PlatformBuilder { public String[] getVMOptions( final PlatformContext context ) { NullArgumentException.validateNotNull( context, "Platform context" ); final Collection<String> vmOptions = new ArrayList<String>(); final File workingDirectory = context.getWorkingD...
### Question: CommandLineImpl implements CommandLine { public String[] getMultipleOption( final String key ) { final List<String> values = m_options.get( key ); return values == null || values.size() == 0 ? new String[0] : values.toArray( new String[values.size()] ); } CommandLineImpl( final String... args ); String ge...
### Question: PlatformImpl implements Platform { void validateBundle( final URL url, final File file ) throws PlatformException { String bundleSymbolicName = null; String bundleName = null; JarFile jar = null; try { jar = new JarFile( file, false ); final Manifest manifest = jar.getManifest(); if ( manifest == null ) {...
### Question: ConfigurationImpl implements Configuration { public String getProperty( final String key ) { return m_properties.getProperty( key ); } ConfigurationImpl( final String url ); String getProperty( final String key ); @SuppressWarnings( "unchecked" ) String[] getPropertyNames( final String regex ); }### Answ...
### Question: ExecutionEnvironment { public String getSystemPackages() { return m_systemPackages; } ExecutionEnvironment( final String ee ); String getSystemPackages(); String getExecutionEnvironment(); static String join( final Collection<String> toJoin, final String delimiter ); }### A...
### Question: ConfigurationImpl extends PropertyStore implements Configuration { public String getWorkingDirectory() { if( !contains( ServiceConstants.CONFIG_WORKING_DIRECTORY ) ) { String workDir = m_propertyResolver.get( ServiceConstants.CONFIG_WORKING_DIRECTORY ); if( workDir == null ) { workDir = DEFAULT_WORKING_DI...
### Question: ConfigurationImpl extends PropertyStore implements Configuration { public String getSystemPackages() { if( !contains( ServiceConstants.CONFIG_SYSTEM_PACKAGES ) ) { return set( ServiceConstants.CONFIG_SYSTEM_PACKAGES, m_propertyResolver.get( ServiceConstants.CONFIG_SYSTEM_PACKAGES ) ); } return get( Servic...
### Question: ConfigurationImpl extends PropertyStore implements Configuration { public String getExecutionEnvironment() { if( !contains( ServiceConstants.CONFIG_EXECUTION_ENV ) ) { String javaVersion = m_propertyResolver.get( ServiceConstants.CONFIG_EXECUTION_ENV ); if( javaVersion == null ) { javaVersion = "J2SE-" + ...
### Question: ConfigurationImpl extends PropertyStore implements Configuration { public String getJavaHome() { if( !contains( ServiceConstants.CONFIG_JAVA_HOME ) ) { String javaHome = m_propertyResolver.get( ServiceConstants.CONFIG_JAVA_HOME ); if( javaHome == null ) { javaHome = System.getProperty( "JAVA_HOME" ); if( ...
### Question: ConfigurationImpl extends PropertyStore implements Configuration { public String getProfiles() { if( !contains( ServiceConstants.CONFIG_PROFILES ) ) { return set( ServiceConstants.CONFIG_PROFILES, m_propertyResolver.get( ServiceConstants.CONFIG_PROFILES ) ); } return get( ServiceConstants.CONFIG_PROFILES ...
### Question: ConfigurationImpl extends PropertyStore implements Configuration { public String getFrameworkProfile() { if( !contains( ServiceConstants.CONFIG_FRAMEWORK_PROFILE ) ) { String profile = m_propertyResolver.get( ServiceConstants.CONFIG_FRAMEWORK_PROFILE ); if( profile == null ) { profile = DEFAULT_FRAMEWORK_...
### Question: Activator implements BundleActivator { public void stop( final BundleContext bundleContext ) throws Exception { NullArgumentException.validateNotNull( bundleContext, "Bundle context" ); if( m_serviceTracker != null ) { m_serviceTracker.close(); m_serviceTracker = null; } if( m_registrations != null ) { fo...
### Question: ConfigurationImpl extends PropertyStore implements Configuration { public Boolean isDownloadFeedback() { if( !contains( ServiceConstants.CONFIG_DOWNLOAD_FEEDBACK ) ) { String downloadFeedback = m_propertyResolver.get( ServiceConstants.CONFIG_DOWNLOAD_FEEDBACK ); if( downloadFeedback == null ) { downloadFe...
### Question: AbstractPlatformBuilderActivator implements BundleActivator { public void start( final BundleContext bundleContext ) throws Exception { NullArgumentException.validateNotNull( bundleContext, "Bundle context" ); m_bundleContext = bundleContext; registerPlatformBuilders( createPlatformBuilders( m_bundleConte...
### Question: AbstractPlatformBuilderActivator implements BundleActivator { public void stop( final BundleContext bundleContext ) throws Exception { NullArgumentException.validateNotNull( bundleContext, "Bundle context" ); if( m_platformBuilderServiceReg != null ) { for( ServiceRegistration registration : m_platformBui...
### Question: Activator implements BundleActivator { public void start( final BundleContext bundleContext ) throws Exception { NullArgumentException.validateNotNull( bundleContext, "Bundle context" ); m_bundleContext = bundleContext; m_extender = createExtender(); m_extender.start(); trackURLStreamHandlerService(); LOG...
### Question: Activator implements BundleActivator { public void stop( final BundleContext bundleContext ) throws Exception { NullArgumentException.validateNotNull( bundleContext, "Bundle context" ); if( m_serviceTracker != null ) { m_serviceTracker.close(); m_serviceTracker = null; } m_extender = null; m_bundleContext...
### Question: URLUtils { public static URLStreamHandlerFactory getURLStreamHandlerFactory() { Field field = getURLStreamHandlerFactoryField(); field.setAccessible( true ); try { return (URLStreamHandlerFactory) field.get( null ); } catch( IllegalAccessException e ) { throw new RuntimeException( "Cannot access URLStream...
### Question: URLUtils { public static void setURLStreamHandlerFactory( final URLStreamHandlerFactory urlStreamHandlerFactory ) { try { URL.setURLStreamHandlerFactory( urlStreamHandlerFactory ); } catch( Error err ) { LOGGER.debug( "URLStreamHandlerFactory already set in the system. Replacing it with a composite" ); sy...
### Question: URLStreamHandlerExtender implements URLStreamHandlerFactory { public void register( final String[] protocols, final URLStreamHandlerService urlStreamHandlerService ) { LOGGER.debug( "Registering protocols [" + Arrays.toString( protocols ) + "] to service [" + urlStreamHandlerService + "]" ); NullArgumentE...
### Question: URLStreamHandlerExtender implements URLStreamHandlerFactory { public void unregister( final String[] protocols ) { LOGGER.debug( "Unregistering protocols [" + Arrays.toString( protocols ) + "]" ); NullArgumentException.validateNotEmptyContent( protocols, true, "Protocols" ); for( String protocol : protoco...
### Question: URLStreamHandlerExtender implements URLStreamHandlerFactory { public URLStreamHandler createURLStreamHandler( final String protocol ) { NullArgumentException.validateNotEmpty( protocol, true, "Protocol" ); return m_proxies.get( protocol ); } URLStreamHandlerExtender(); void start(); void register( final S...
### Question: ConciergePlatformBuilder implements PlatformBuilder { public String getMainClassName() { return MAIN_CLASS_NAME; } ConciergePlatformBuilder( final BundleContext bundleContext, final String version ); void prepare( final PlatformContext context ); String getMainClassName(); String[] getArguments( final Pla...
### Question: ConciergePlatformBuilder implements PlatformBuilder { public String getRequiredProfile( final PlatformContext context ) { final Boolean console = context.getConfiguration().startConsole(); if( console == null || !console ) { return null; } else { return CONSOLE_PROFILE; } } ConciergePlatformBuilder( final...
### Question: CordeauReader { public CordeauReader(VehicleRoutingProblem.Builder vrpBuilder) { super(); this.vrpBuilder = vrpBuilder; } CordeauReader(VehicleRoutingProblem.Builder vrpBuilder); void read(String fileName); void setCoordProjectionFactor(double coordProjectionFactor); }### Answer: @Test public void testCo...
### Question: VehicleImpl extends AbstractVehicle { @Override public Location getEndLocation() { return endLocation; } private VehicleImpl(Builder builder); static Vehicle copyOf(Vehicle vehicle); static NoVehicle createNoVehicle(); @Override String toString(); @Override double getEarliestDeparture(); @Override double...
### Question: VehicleImpl extends AbstractVehicle { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VehicleImpl other = (VehicleImpl) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equal...
### Question: VehicleTypeImpl implements VehicleType { @Override public Capacity getCapacityDimensions() { return capacityDimensions; } private VehicleTypeImpl(VehicleTypeImpl.Builder builder); @Override boolean equals(Object o); @Override int hashCode(); @Override Object getUserData(); @Override String getTypeId(); @...
### Question: VehicleTypeImpl implements VehicleType { @Override public String getTypeId() { return typeId; } private VehicleTypeImpl(VehicleTypeImpl.Builder builder); @Override boolean equals(Object o); @Override int hashCode(); @Override Object getUserData(); @Override String getTypeId(); @Override VehicleTypeImpl.V...
### Question: VehicleTypeImpl implements VehicleType { @Override public double getMaxVelocity() { return maxVelocity; } private VehicleTypeImpl(VehicleTypeImpl.Builder builder); @Override boolean equals(Object o); @Override int hashCode(); @Override Object getUserData(); @Override String getTypeId(); @Override Vehicle...
### Question: VehicleTypeImpl implements VehicleType { @Override public VehicleTypeImpl.VehicleCostParams getVehicleCostParams() { return vehicleCostParams; } private VehicleTypeImpl(VehicleTypeImpl.Builder builder); @Override boolean equals(Object o); @Override int hashCode(); @Override Object getUserData(); @Overrid...
### Question: VehicleTypeImpl implements VehicleType { @Override public String getProfile() { return profile; } private VehicleTypeImpl(VehicleTypeImpl.Builder builder); @Override boolean equals(Object o); @Override int hashCode(); @Override Object getUserData(); @Override String getTypeId(); @Override VehicleTypeImpl...
### Question: VehicleTypeImpl implements VehicleType { @Override public Object getUserData() { return userData; } private VehicleTypeImpl(VehicleTypeImpl.Builder builder); @Override boolean equals(Object o); @Override int hashCode(); @Override Object getUserData(); @Override String getTypeId(); @Override VehicleTypeIm...
### Question: JobInsertionContext { public VehicleRoute getRoute() { return route; } JobInsertionContext(VehicleRoute route, Job job, Vehicle newVehicle, Driver newDriver, double newDepTime); VehicleRoute getRoute(); Job getJob(); Vehicle getNewVehicle(); Driver getNewDriver(); double getNewDepTime(); List<TourActivity...
### Question: JobInsertionContext { public Job getJob() { return job; } JobInsertionContext(VehicleRoute route, Job job, Vehicle newVehicle, Driver newDriver, double newDepTime); VehicleRoute getRoute(); Job getJob(); Vehicle getNewVehicle(); Driver getNewDriver(); double getNewDepTime(); List<TourActivity> getAssociat...
### Question: JobInsertionContext { public Vehicle getNewVehicle() { return newVehicle; } JobInsertionContext(VehicleRoute route, Job job, Vehicle newVehicle, Driver newDriver, double newDepTime); VehicleRoute getRoute(); Job getJob(); Vehicle getNewVehicle(); Driver getNewDriver(); double getNewDepTime(); List<TourAct...
### Question: JobInsertionContext { public Driver getNewDriver() { return newDriver; } JobInsertionContext(VehicleRoute route, Job job, Vehicle newVehicle, Driver newDriver, double newDepTime); VehicleRoute getRoute(); Job getJob(); Vehicle getNewVehicle(); Driver getNewDriver(); double getNewDepTime(); List<TourActivi...
### Question: JobInsertionContext { public double getNewDepTime() { return newDepTime; } JobInsertionContext(VehicleRoute route, Job job, Vehicle newVehicle, Driver newDriver, double newDepTime); VehicleRoute getRoute(); Job getJob(); Vehicle getNewVehicle(); Driver getNewDriver(); double getNewDepTime(); List<TourActi...
### Question: JobInsertionContext { public List<TourActivity> getAssociatedActivities() { return associatedActivities; } JobInsertionContext(VehicleRoute route, Job job, Vehicle newVehicle, Driver newDriver, double newDepTime); VehicleRoute getRoute(); Job getJob(); Vehicle getNewVehicle(); Driver getNewDriver(); doubl...
### Question: Location implements HasIndex, HasId { public static Location newInstance(double x, double y) { return Location.Builder.newInstance().setCoordinate(Coordinate.newInstance(x, y)).build(); } private Location(Builder builder); static Location newInstance(double x, double y); static Location newInstance(Strin...
### Question: VehicleRoutingProblem { public FleetSize getFleetSize() { return fleetSize; } private VehicleRoutingProblem(Builder builder); @Override String toString(); FleetSize getFleetSize(); Map<String, Job> getJobs(); Collection<Job> getJobsWithLocation(); Map<String, Job> getJobsInclusiveInitialJobsInRoutes(); C...
### Question: VehicleRoutingProblem { public Collection<Vehicle> getVehicles() { return Collections.unmodifiableCollection(vehicles); } private VehicleRoutingProblem(Builder builder); @Override String toString(); FleetSize getFleetSize(); Map<String, Job> getJobs(); Collection<Job> getJobsWithLocation(); Map<String, J...
### Question: VehicleRoutingProblem { public Collection<VehicleType> getTypes() { return Collections.unmodifiableCollection(vehicleTypes); } private VehicleRoutingProblem(Builder builder); @Override String toString(); FleetSize getFleetSize(); Map<String, Job> getJobs(); Collection<Job> getJobsWithLocation(); Map<Stri...
### Question: VehicleRoutingProblem { public VehicleRoutingActivityCosts getActivityCosts() { return activityCosts; } private VehicleRoutingProblem(Builder builder); @Override String toString(); FleetSize getFleetSize(); Map<String, Job> getJobs(); Collection<Job> getJobsWithLocation(); Map<String, Job> getJobsInclusi...
### Question: VehicleRoutingProblem { public VehicleRoutingTransportCosts getTransportCosts() { return transportCosts; } private VehicleRoutingProblem(Builder builder); @Override String toString(); FleetSize getFleetSize(); Map<String, Job> getJobs(); Collection<Job> getJobsWithLocation(); Map<String, Job> getJobsIncl...
### Question: VehicleRoutingProblem { public Collection<VehicleRoute> getInitialVehicleRoutes() { Collection<VehicleRoute> copiedInitialRoutes = new ArrayList<>(); for (VehicleRoute route : initialVehicleRoutes) { copiedInitialRoutes.add(VehicleRoute.copyOf(route)); } return copiedInitialRoutes; } private VehicleRouti...
### Question: Capacity { public int getNuOfDimensions() { return dimensions.length; } private Capacity(Capacity capacity); private Capacity(Builder builder); static Capacity addup(Capacity cap1, Capacity cap2); static Capacity subtract(Capacity cap, Capacity cap2subtract); static Capacity invert(Capacity cap2invert);...
### Question: Capacity { public int get(int index) { if (index < dimensions.length) return dimensions[index]; return 0; } private Capacity(Capacity capacity); private Capacity(Builder builder); static Capacity addup(Capacity cap1, Capacity cap2); static Capacity subtract(Capacity cap, Capacity cap2subtract); static C...
### Question: Capacity { public static Capacity copyOf(Capacity capacity) { if (capacity == null) return null; return new Capacity(capacity); } private Capacity(Capacity capacity); private Capacity(Builder builder); static Capacity addup(Capacity cap1, Capacity cap2); static Capacity subtract(Capacity cap, Capacity c...
### Question: Capacity { public static Capacity addup(Capacity cap1, Capacity cap2) { if (cap1 == null || cap2 == null) throw new NullPointerException("arguments must not be null"); Capacity.Builder capacityBuilder = Capacity.Builder.newInstance(); for (int i = 0; i < Math.max(cap1.getNuOfDimensions(), cap2.getNuOfDime...
### Question: Capacity { public static Capacity subtract(Capacity cap, Capacity cap2subtract) { if (cap == null || cap2subtract == null) throw new NullPointerException("arguments must not be null"); Capacity.Builder capacityBuilder = Capacity.Builder.newInstance(); for (int i = 0; i < Math.max(cap.getNuOfDimensions(), ...
### Question: Capacity { @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Capacity)) return false; Capacity capacity = (Capacity) o; return Arrays.equals(dimensions, capacity.dimensions); } private Capacity(Capacity capacity); private Capacity(Builder builder); static Capacit...
### Question: Shipment extends AbstractJob { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Shipment other = (Shipment) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) ...