conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Check the operation of the java.validation.constraints for the GraphRepresentation class.\n" }, { "from": "gpt", "value": "package uk.ac.ebi.quickgo.ontology.model;\n\nimport javax.validation.Validator;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.ju...
java
chosen
[ { "from": "human", "value": "Create an interface for providers that support injection\n" }, { "from": "gpt", "value": "/*\n * Copyright 2016 Michael Rozumyanskiy\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the ...
java
chosen
[ { "from": "human", "value": "Add QueryChecker adapter implementation skeleton." }, { "from": "gpt", "value": "// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n...
java
chosen
[ { "from": "human", "value": "Create a module to allow for sequence input with SAXS data. This module\nis unfinished" }, { "from": "gpt", "value": "package se.raddo.raddose3D;\n\nimport java.util.List;\n\npublic class CoefCalcFromSequenceSAXS extends CoefCalcCompute {\n /**\n * Right angle.\n ...
java
chosen
[ { "from": "human", "value": "Use XOR to encode and decode a message\n\nhttp://ideone.com/90dHdA" }, { "from": "gpt", "value": "// Use XOR to encode and decode a message.\nclass Encode {\n\tpublic static void main(String args[]) {\n\t\tString msg = \"This is a test\";\n\t\tString encmsg = \"\";\n...
java
chosen
[ { "from": "human", "value": "Test helpder needs to behere too.\n" }, { "from": "gpt", "value": "package io.muoncore.protocol.reactivestream.server;\n\nimport io.muoncore.channel.ChannelConnection;\n\n/*\n * workaround for inability to directly invoke lambdas from groovy without the dynamic coerc...
java
chosen
[ { "from": "human", "value": "Add unit tests for FutureCallbackAdapter\n" }, { "from": "gpt", "value": "package com.github.vbauer.caesar.callback;\n\nimport com.github.vbauer.caesar.basic.BasicTest;\nimport org.junit.Assert;\nimport org.junit.Test;\n\nimport java.util.concurrent.atomic.AtomicBool...
java
chosen
[ { "from": "human", "value": "Add test for UTF8 encoding issues in ASCII armor\n" }, { "from": "gpt", "value": "package org.bouncycastle.openpgp.test;\n\nimport org.bouncycastle.bcpg.ArmoredOutputStream;\nimport org.bouncycastle.util.test.SimpleTest;\n\nimport java.io.ByteArrayOutputStream;\nimpo...
java
chosen
[ { "from": "human", "value": "Add test fixture for testing serialization\n\n+review REVIEW-6315\n" }, { "from": "gpt", "value": "/*\n * Copyright 2016 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in ...
java
chosen
[ { "from": "human", "value": "Add dummy implementation of SslContextFactoryProvider\n" }, { "from": "gpt", "value": "// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.\npackage com.yahoo.jdisc.http.ssl;\n\nimport org.eclipse.jett...
java
chosen
[ { "from": "human", "value": "Fix json artist gender output\n" }, { "from": "gpt", "value": "/* Copyright (c) 2018 Sambhav Kothari\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following condit...
java
chosen
[ { "from": "human", "value": "Add some basic sanity checking for AnnotationLiteral\n" }, { "from": "gpt", "value": "package com.episode6.hackit.mockspresso.reflect;\n\nimport com.episode6.hackit.mockspresso.DefaultTestRunner;\nimport com.episode6.hackit.mockspresso.annotation.TestQualifierAnnotat...
java
chosen
[ { "from": "human", "value": "Add unit tests for boolean matcher parsing" }, { "from": "gpt", "value": "package org.monospark.spongematchers.parser.primitive;\n\nimport static org.hamcrest.CoreMatchers.not;\nimport static org.junit.Assert.assertThat;\nimport static org.junit.Assert.assertTrue;\ni...
java
chosen
[ { "from": "human", "value": "Add sample abstract java class\n" }, { "from": "gpt", "value": "package com.gentest;\npublic abstract class AbstractJavaClass {\n public AbstractJavaClass(String a, String b) {\n System.out.println(\"Constructor: a, b\");\n }\n public AbstractJavaClass(String a...
java
chosen
[ { "from": "human", "value": "Add simple impl of NodeExecutorResult\n" }, { "from": "gpt", "value": "/*\n * Copyright 2011 DTO Solutions, Inc. (http://dtosolutions.com)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance w...
java
chosen
[ { "from": "human", "value": "Tests: Add noop test to prevent test failures\n\nRelates elastic/x-pack-elasticsearch#2920\n\nOriginal commit: elastic/x-pack-elasticsearch@c2fe9d985c601de96da46a55b98d022ce444d493\n" }, { "from": "gpt", "value": "/*\n * Copyright Elasticsearch B.V. and/or licensed t...
java
chosen
[ { "from": "human", "value": "[SECURITY-902] Add an implementation of ISecurityManagement that can use the SecurityFactory to find a globally registered implementation to delegate to.\n" }, { "from": "gpt", "value": "/*\n * JBoss, Home of Professional Open Source.\n * Copyright 2015, Red Hat, Inc...
java
chosen
[ { "from": "human", "value": "Add list contains all example\n" }, { "from": "gpt", "value": "package com.levelup.java.collections;\n\nimport static org.junit.Assert.assertTrue;\n\nimport java.util.Collection;\nimport java.util.List;\n\nimport org.apache.commons.collections.CollectionUtils;\nimpor...
java
chosen
[ { "from": "human", "value": "Add basic DAO for votes" }, { "from": "gpt", "value": "package wissolsoft.porada.webapp.dao;\n\nimport org.hibernate.Session;\nimport org.hibernate.SessionFactory;\nimport org.hibernate.Transaction;\nimport org.springframework.beans.factory.annotation.Autowired;\nimp...
java
chosen
[ { "from": "human", "value": "Add an exception for CSV export errors" }, { "from": "gpt", "value": "/*\n * Copyright 2014 Codenvy, S.A.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtai...
java
chosen
[ { "from": "human", "value": "Add a LogUtil to print consistent log message\n" }, { "from": "gpt", "value": "package com.asascience.ncsos.util;\n\nimport java.io.PrintWriter;\nimport java.io.StringWriter;\n\npublic class LogUtils {\n\n public static String exceptionAsString(Exception exception...
java
chosen
[ { "from": "human", "value": "Implement the Page Factory Pattern and methods for search any course\n" }, { "from": "gpt", "value": "/**\n * Created with IntelliJ IDEA.\n * User: jhasmanyquiroz\n * Date: 11/12/15\n * Time: 3:07 PM\n * To change this template use File | Settings | File Templates.\n...
java
chosen
[ { "from": "human", "value": "Test dirs along with the first test case of jabref for the AuthorLastFirstAbbreviator\nformater.\n\n" }, { "from": "gpt", "value": "package tests.net.sf.jabref.export.layout.format;\n\nimport net.sf.jabref.export.layout.format.AuthorLastFirstAbbreviator;\nimport juni...
java
chosen
[ { "from": "human", "value": "Substitute DefaultMethodFallbackProvider in GraalVM < 21.0\n" }, { "from": "gpt", "value": "package io.quarkus.smallrye.faulttolerance.runtime.graal;\n\nimport java.lang.reflect.InvocationTargetException;\nimport java.lang.reflect.Method;\nimport java.util.function.B...
java
chosen
[ { "from": "human", "value": "Create a JUL handler using Raven\n" }, { "from": "gpt", "value": "package net.kencochrane.raven.jul;\n\nimport net.kencochrane.raven.Raven;\nimport net.kencochrane.raven.event.EventBuilder;\nimport net.kencochrane.raven.event.LoggedEvent;\nimport net.kencochrane.rave...
java
chosen
[ { "from": "human", "value": "Add locator that will delegate to list of locators\n" }, { "from": "gpt", "value": "package org.realityforge.replicant.client;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport javax.annotation.Nonnull;\nimport javax.annotation.Nullable;\nimport static o...
java
chosen
[ { "from": "human", "value": "Create : 28 Implement strStr()\n" }, { "from": "gpt", "value": "public class Solution {\n\n public int strStr(String haystack, String needle) {\n\n for (int i = 0; i <= haystack.length() - needle.length(); i++) {\n\n int j = 0;\n for (...
java
chosen
[ { "from": "human", "value": "Add a test config for the heck of it. Thank you Choonster for your TestMod3.\n" }, { "from": "gpt", "value": "package tld.testmod;\n\n/*\n Licenses for assets can be found in ASSETS_LICENSE.txt. All other files are licensed under the terms below:\n \n The MI...
java
chosen
[ { "from": "human", "value": "Create skeleton for problem 122\n" }, { "from": "gpt", "value": "package leetcode;\n\n/**\n * https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/\n */\npublic class Problem122 {\n public int maxProfit(int[] prices) {\n return 0;\n }\n \n...
java
chosen
[ { "from": "human", "value": "Add Reverse Nodes In K Groups\n" }, { "from": "gpt", "value": "package problems;\n\npublic class ReverseNodesInGroups {\n\n public class ListNode {\n int val;\n ListNode next;\n\n ListNode(int x) {\n val = x;\n next = nul...
java
chosen
[ { "from": "human", "value": "ENG-19936:\nAdd new class to support DIRECTED PROECEDURE FROM CLASS scenario added to FullDDL.\n" }, { "from": "gpt", "value": "/* This file is part of VoltDB.\n * Copyright (C) 2008-2020 VoltDB Inc.\n *\n * Permission is hereby granted, free of charge, to any person...
java
chosen
[ { "from": "human", "value": "Add class missed in last commit\n" }, { "from": "gpt", "value": "package org.openmhealth.shim.withings.domain;\n\n\n/**\n * A body measure type included in responses from the Withings body measure endpoint, specifically in a 'meastype'\n * property.\n *\n * @author C...
java
chosen
[ { "from": "human", "value": "Add no placement u bucket item" }, { "from": "gpt", "value": "package info.u_team.u_team_core.item;\n\nimport java.util.function.Supplier;\n\nimport net.minecraft.entity.player.PlayerEntity;\nimport net.minecraft.fluid.Fluid;\nimport net.minecraft.item.*;\nimport net...
java
chosen
[ { "from": "human", "value": "Refactor ownership transfer to service\n\nSVN-Revision: 19386\n" }, { "from": "gpt", "value": "package gov.nih.nci.cananolab.service.admin;\n\nimport gov.nih.nci.cananolab.service.protocol.ProtocolService;\nimport gov.nih.nci.cananolab.service.publication.Publication...
java
chosen
[ { "from": "human", "value": "Create a filter to check if the user can access oAuth admin\n" }, { "from": "gpt", "value": "package uk.ac.ox.oucs.oauth.admin;\n\nimport org.sakaiproject.authz.api.FunctionManager;\nimport org.sakaiproject.authz.api.SecurityService;\nimport org.sakaiproject.componen...
java
chosen
[ { "from": "human", "value": "Add spring controller for wizard\n" }, { "from": "gpt", "value": "package alien4cloud.ui;\r\n\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\n\r\n@Controller\r\npublic class WizardController {\...
java
chosen
[ { "from": "human", "value": "[ANDROSDK-637] Add data value package tests\n" }, { "from": "gpt", "value": "package org.hisp.dhis.android.testapp.datavalue;\n\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.hisp.dhis.android.core.datavalue.DataValue;\nimport org.hisp.dhis.android....
java
chosen
[ { "from": "human", "value": "Add test for parsing file path from command line\n" }, { "from": "gpt", "value": "package com.phsshp.config;\n\nimport org.junit.Test;\n\nimport static org.hamcrest.CoreMatchers.equalTo;\nimport static org.hamcrest.MatcherAssert.assertThat;\n\npublic class CommandLin...
java
chosen
[ { "from": "human", "value": "Create the class rate to registry the value of a fund." }, { "from": "gpt", "value": "package cl.fatman.capital.fund;\n\nimport javax.persistence.Column;\nimport javax.persistence.Entity;\nimport javax.persistence.GeneratedValue;\nimport javax.persistence.Id;\nimport...
java
chosen
[ { "from": "human", "value": "Add java solution for 165. Compare Version Numbers\n\n165. Compare Version Numbers: https://leetcode.com/problems/compare-version-numbers/" }, { "from": "gpt", "value": "package leetcode.compare_version_numbers;\n\npublic class Solution {\n public int compareVersi...
java
chosen
[ { "from": "human", "value": "Add a class to test serialization of objects\n\ngit-svn-id: 5d5bc0d97dbe9d074e4c1656445fd2f468e4e619@378 5a62d92b-e016-0410-9103-b89fe532bb34\n" }, { "from": "gpt", "value": "/*\n * Nividic development code\n *\n * This code may be freely distrib...
java
chosen
[ { "from": "human", "value": "Add interface for building plugins in Java instead of XML/JSON.\n\n - Part of LOG4J2-653.\n\ngit-svn-id: de5ce936019686f47409c93bcc5e202a9739563b@1597484 13f79535-47bb-0310-9956-ffa450edef68\n" }, { "from": "gpt", "value": "/*\n * Licensed to the Apache Software Fou...
java
chosen
[ { "from": "human", "value": "Test for OR-346: setting valid, invalid and null region (initial version)\n\ngit-svn-id: 996c6d7d570f9e8d676b69394667d4ecb3e4cdb3@25347 1580c273-15eb-1042-8a87-dc5d815c88a0\n" }, { "from": "gpt", "value": "package org.openregistry.core.domain.jpa;\r\n\r\nimport stati...
java
chosen
[ { "from": "human", "value": "Add simple test for zero parser\n" }, { "from": "gpt", "value": "package com.example.playground.monadic.parser.combinators;\n\nimport org.junit.Test;\n\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.stream.IntStream;\n\nimport static org.ham...
java
chosen
[ { "from": "human", "value": "Add unit test for fudge builder\n" }, { "from": "gpt", "value": "/**\n * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies\n *\n * Please see distribution for license.\n */\npackage com.opengamma.engine.fudgemsg;\n\nimport java.util....
java
chosen
[ { "from": "human", "value": "Create class for subscription service tests.\n" }, { "from": "gpt", "value": "/*\n * Copyright 2016, TeamDev Ltd. All rights reserved.\n *\n * Redistribution and use in source and/or binary forms, with or without\n * modification, must retain the above copyright noti...
java
chosen
[ { "from": "human", "value": "Add Tupel class to hold min and max value\n" }, { "from": "gpt", "value": "package net.tlahmann.gdg.creation.helper;\n\npublic class Tuple<X, Y> {\n\tpublic X x;\n\tpublic Y y;\n\n\tpublic Tuple(X x, Y y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n}\n" } ]
java
chosen
[ { "from": "human", "value": "Add an errow view for navigator\n" }, { "from": "gpt", "value": "/*\n * Copyright 2015 Ryan Gilera.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a cop...
java
chosen
[ { "from": "human", "value": "Add integration test for VaultReactiveHealthIndicator\n\nAdd test for the reactive health indicator.\n\nSee gh-397\n" }, { "from": "gpt", "value": "/*\n * Copyright 2020 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lic...
java
chosen
[ { "from": "human", "value": "Add the optional transient annotation\n\ngit-svn-id: 4741f78aa2d3279ddd0a34c053c42ca3ce19451b@703 124fc276-1b20-0410-8d16-dc08e6bff5e9\n" }, { "from": "gpt", "value": "/*\r\n * Transient.java June 2007\r\n *\r\n * Copyright (C) 2007, Niall Gallagher <niallg@users.sf....
java
chosen
[ { "from": "human", "value": "Add a simplistic move fitness evaluation\n" }, { "from": "gpt", "value": "/* @(#)MoveFitness.java\n */\n/**\n * Class containing all of the business logic regarding whether a\n * move is considered good or not.\n *\n * @author <a href=\"mailto:geoff@minty-dark-towe...
java
chosen
[ { "from": "human", "value": "Stop PCJ threads on error/abort.\n" }, { "from": "gpt", "value": "/*\n * Copyright (c) 2011-2019, PCJ Library, Marek Nowicki\n * All rights reserved.\n *\n * Licensed under New BSD License (3-clause license).\n *\n * See the file \"LICENSE\" for the full license gove...
java
chosen
[ { "from": "human", "value": "Add problem Java Anagrams, HackerRank/Java/Strings/Java String\n" }, { "from": "gpt", "value": "package javaAnagrams;\n\nimport java.util.Scanner;\n\n\npublic class Solution {\n\n\t static boolean isAnagram(String A, String B) {\n\t\t if( A.length() != B.length()...
java
chosen
[ { "from": "human", "value": "Add delivery receipt test case\n\ngit-svn-id: 8aef34885c21801cc977f98956a081c938212632@181 1678c8a9-8d33-0410-b0a4-d546c816ed44\n" }, { "from": "gpt", "value": "package org.jsmpp.util;\n\nimport static org.testng.Assert.*;\nimport org.jsmpp.bean.DeliveryReceipt;\nimp...
java
chosen
[ { "from": "human", "value": "Solve No.8958 from Baekjoon Online Judge\n" }, { "from": "gpt", "value": "/*\n * Copyright 2017 haeun kim\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain...
java
chosen
[ { "from": "human", "value": "Add driving class with main method" }, { "from": "gpt", "value": "package com.grayben.riskExtractor;\n\nimport java.io.File;\n\nimport com.grayben.riskExtractor.htmlScorer.HtmlScorer;\nimport com.grayben.riskExtractor.htmlScorer.ArrayListScoredText;\nimport com.grayb...
java
chosen
[ { "from": "human", "value": "Test TraitementPcm getPcm is not null\n" }, { "from": "gpt", "value": "package org.opencompare;\n\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.opencompare.api.java.PCMElement;\nimport org.opencompare.api.java.PCMFactory;\nimport org.opencompare.api.j...
java
chosen
[ { "from": "human", "value": "Add new true reloading test" }, { "from": "gpt", "value": "package org.jsconf.core.test;\n\nimport java.io.File;\nimport java.io.FileWriter;\nimport java.io.IOException;\n\nimport org.jsconf.core.ConfigurationFactory;\nimport org.jsconf.core.sample.bean.ConfigBean;\n...
java
chosen
[ { "from": "human", "value": "ADD: Test suite for test that will be run as a normal JUnit test.\n" }, { "from": "gpt", "value": "package eme;\n\nimport org.junit.runner.RunWith;\nimport org.junit.runners.Suite;\nimport org.junit.runners.Suite.SuiteClasses;\n\nimport eme.generator.EObjectGenerator...
java
chosen
[ { "from": "human", "value": "Add settings class to common package\n" }, { "from": "gpt", "value": "package SecureElection.Common;\n\n/**\n * Created by kalas on 2015-11-20.\n */\npublic class Settings {\n public static final int CLA_PORT = 8988;\n public static final int CTF_PORT = 8989;\n...
java
chosen
[ { "from": "human", "value": "Add java solution for 101. Symmetric Tree\n\n101. Symmetric Tree: https://leetcode.com/problems/symmetric-tree/" }, { "from": "gpt", "value": "package leetcode.symmetric_tree;\n\nimport common.TreeNode;\n\npublic class Solution {\n\tpublic boolean isSymmetric(TreeNod...
java
chosen
[ { "from": "human", "value": "Add stat command class file\n" }, { "from": "gpt", "value": "/*\n * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0\n * (the \"License\"). You may not use this work except in compliance with the License, which is\n * available at ...
java
chosen
[ { "from": "human", "value": "Add DB store for DataValueSets\n" }, { "from": "gpt", "value": "package org.hisp.dhis.android.core.datavalue;\n\nimport android.database.Cursor;\nimport android.database.sqlite.SQLiteStatement;\n\nimport org.hisp.dhis.android.core.common.State;\nimport org.hisp.dhis....
java
chosen
[ { "from": "human", "value": "Add interface for lottery event notifications\n" }, { "from": "gpt", "value": "/**\n * The MIT License\n * Copyright (c) 2014 Ilkka Seppälä\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated docume...
java
chosen
[ { "from": "human", "value": "Add DirectoryStream example with filter\n" }, { "from": "gpt", "value": "package learn_to_code.java_api.io_and_nio.nio;\r\n\r\nimport learn_to_code.java_api.io_and_nio.io.FilesCreatorIO;\r\n\r\nimport java.io.IOException;\r\nimport java.nio.file.DirectoryStream;\r\ni...
java
chosen
[ { "from": "human", "value": "Remove Spaces - O(n^2) complexity [Not recommended]" }, { "from": "gpt", "value": "package com.deepak.Strings;\n\n/**\n * <p>Problem Statement</p>\n * <p> Given a string of characters consisting of 0 or more spaces, \n * remove all the spaces from this given string. ...
java
chosen
[ { "from": "human", "value": "Add new exception type when commands fail\n\n\ngit-svn-id: cd28ba526fba5b39766c0a4e72305690b33c2c6e@662168 13f79535-47bb-0310-9956-ffa450edef68\n" }, { "from": "gpt", "value": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor ...
java
chosen
[ { "from": "human", "value": "Add convert all list item class.\n" }, { "from": "gpt", "value": "package com.jshoresdevelopment.conversioncalculator;\n\nimport lombok.Getter;\nimport lombok.Setter;\n\n@Getter\n@Setter\npublic class AllUnitListItem {\n private String value;\n private String u...
java
chosen
[ { "from": "human", "value": "Add java solution for 46. Permutations\n\n46. Permutations: https://leetcode.com/problems/permutations/\n" }, { "from": "gpt", "value": "package leetcode.permutations;\n\nimport java.util.ArrayList;\n\npublic class Solution {\n\tpublic void dfs(ArrayList<ArrayList<In...
java
chosen
[ { "from": "human", "value": "Add Automaton block replace rule\n" }, { "from": "gpt", "value": "package com.elmakers.mine.bukkit.world.block.builtin;\n\nimport java.util.Deque;\nimport java.util.Random;\nimport javax.annotation.Nonnull;\n\nimport org.bukkit.Location;\nimport org.bukkit.block.Bloc...
java
chosen
[ { "from": "human", "value": "Test that jandex plugin is ran on quarkusBuild task\n" }, { "from": "gpt", "value": "package io.quarkus.gradle;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.io.File;\n\nimport org.junit.jupiter.api.Test;\n\npublic class JandexMultiModul...
java
chosen
[ { "from": "human", "value": "Add tests for CalculateDistance class\n" }, { "from": "gpt", "value": "package ru.stqa.pft.sandbox;\n\nimport org.testng.Assert;\nimport org.testng.annotations.Test;\n\n/**\n * Created by Alexander Gorny on 1/25/2017.\n */\npublic class DistanceTest {\n\n @Test\n p...
java
chosen
[ { "from": "human", "value": "Add test for form attribute\n" }, { "from": "gpt", "value": "package com.ushahidi.android.data.entity;\n\nimport com.ushahidi.android.BuildConfig;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.robolectric.RobolectricGradleTestRunner;\nimport...
java
chosen
[ { "from": "human", "value": "Create a byte based storage requirement rule.\n" }, { "from": "gpt", "value": "package com.novoda.downloadmanager;\n\nimport android.os.StatFs;\n\nimport java.io.File;\n\npublic final class ByteBasedStorageRequirementRule implements StorageRequirementRule {\n\n pr...
java
chosen
[ { "from": "human", "value": "Add freezer subsystem test class.\n" }, { "from": "gpt", "value": "package me.haosdent.cgroup.subsystem;\n\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\n\npublic class TestFreezer {\n\n @Before\n public void setUp() {}\n\n @After\n p...
java
chosen
[ { "from": "human", "value": "Add a quickstart example for key-value store\n" }, { "from": "gpt", "value": "/*\n * Licensed to the University of California, Berkeley under one or more contributor license\n * agreements. See the NOTICE file distributed with this work for additional information reg...
java
chosen
[ { "from": "human", "value": "[NGRINDER-209] Fix unit test errors and improve test coverage \n" }, { "from": "gpt", "value": "package org.ngrinder.security;\n\nimport java.io.IOException;\n\nimport javax.servlet.Filter;\nimport javax.servlet.FilterChain;\nimport javax.servlet.FilterConfig;\nimpor...
java
chosen
[ { "from": "human", "value": "Add java solution for 179. Largest Number\n\n179. Largest Number: https://leetcode.com/problems/largest-number/" }, { "from": "gpt", "value": "package leetcode.largest_number;\n\nimport java.util.Arrays;\nimport java.util.Comparator;\n\npublic class Solution {\n p...
java
chosen
[ { "from": "human", "value": "Create : 100 Same Tree\n" }, { "from": "gpt", "value": "/**\n * Definition for a binary tree node.\n * public class TreeNode {\n * int val;\n * TreeNode left;\n * TreeNode right;\n * TreeNode(int x) { val = x; }\n * }\n */\n\npublic class Solution {\n...
java
chosen
[ { "from": "human", "value": "Add Unit test for DocSigning Sample.\n" }, { "from": "gpt", "value": "/*\n * Copyright 2015 Datalogics, Inc.\n */\n\npackage com.datalogics.pdf.samples.sig;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertTrue;\n\nimport com.adob...
java
chosen
[ { "from": "human", "value": "Test cases for Score class\n" }, { "from": "gpt", "value": "package tests;\n\nimport static org.junit.Assert.*;\n\nimport org.junit.Test;\nimport logic.Score;\n\n\npublic class ScoreTests {\n\n\t@Test\n\tpublic void test_initScore() {\n\t\tScore score = new Score(2, ...
java
chosen
[ { "from": "human", "value": "Add in minimalistic game class\n" }, { "from": "gpt", "value": "package starpunk;\n\nimport com.badlogic.gdx.Game;\n\nfinal class StarPunkGame\n extends Game\n{\n public static final int WIDTH = 1280;\n public static final int HEIGHT = 900;\n\n StarPunkGame()\n ...
java
chosen
[ { "from": "human", "value": "Solve No.1157 from Baekjoon Online Judge\n" }, { "from": "gpt", "value": "/*\n * Copyright 2017 haeun kim\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain...
java
chosen
[ { "from": "human", "value": "Add default implementation of ExtendRandom interface.\n" }, { "from": "gpt", "value": "package net.imagej.ops.viewOp;\n\nimport org.scijava.ItemIO;\nimport org.scijava.plugin.Parameter;\nimport org.scijava.plugin.Plugin;\n\nimport net.imagej.ops.view.ViewOps;\nimport...
java
chosen
[ { "from": "human", "value": "Add test cases for parsing filters in plot requests\n" }, { "from": "gpt", "value": "/*\n * Copyright 2014 Rackspace\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n...
java
chosen
[ { "from": "human", "value": "Add test for HttpPostRequestDecoder: validate '\\r' symbols in the end of binary stream are parsed correctly.\n" }, { "from": "gpt", "value": "/*\n * Copyright 2013 The Netty Project\n *\n * The Netty Project licenses this file to you under the Apache License,\n * ve...
java
chosen
[ { "from": "human", "value": "Add class for managing Stata errors\n" }, { "from": "gpt", "value": "package org.matthewjwhite.stata.error;\n\nimport com.stata.sfi.SFIToolkit;\n\npublic class StataError {\n\tpublic static void display(String message, Throwable throwable) {\n\t\tif (message != null ...
java
chosen
[ { "from": "human", "value": "Add a dummy interface inside the uberjar in order to force generation of sources and javadoc jars.\n" }, { "from": "gpt", "value": "/**\n * Copyright (C) 2015 Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use ...
java
chosen
[ { "from": "human", "value": "Add convenience class for CCP menu items\n" }, { "from": "gpt", "value": "package editor.gui.ccp;\n\nimport static java.awt.event.ActionEvent.ACTION_PERFORMED;\n\nimport java.awt.Component;\nimport java.awt.event.ActionEvent;\nimport java.awt.event.KeyEvent;\nimport ...
java
chosen
[ { "from": "human", "value": "[PLAT-3494] Add unit testcase for ViewStatusOption\n" }, { "from": "gpt", "value": "/**\n * Copyright (C) 2013 - present by OpenGamma Inc. and the OpenGamma group of companies\n * \n * Please see distribution for license.\n */\npackage com.opengamma.integration.viewe...
java
chosen
[ { "from": "human", "value": "Add an ugly competency resolver\n" }, { "from": "gpt", "value": "/*\n * Copyright 2012 Shared Learning Collaborative, LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n ...
java
chosen
[ { "from": "human", "value": "Add response builder for unit tests" }, { "from": "gpt", "value": "\npackage org.jenkinsci.plugins.relution_publisher.unittest.mocks;\n\nimport org.apache.http.HttpResponse;\nimport org.apache.http.StatusLine;\nimport org.jenkinsci.plugins.relution_publisher.net.resp...
java
chosen
[ { "from": "human", "value": "Add object for recent buy data\n" }, { "from": "gpt", "value": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of th...
java
chosen
[ { "from": "human", "value": "Add javadoc for storage package.\n" }, { "from": "gpt", "value": "/*\n * Copyright 2014 Google. Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a co...
java
chosen
[ { "from": "human", "value": "Add test case for the original example\n" }, { "from": "gpt", "value": "package org.ojalgo.matrix;\n\nimport static org.ojalgo.function.aggregator.Aggregator.*;\n\nimport org.junit.jupiter.api.Test;\nimport org.ojalgo.TestUtils;\nimport org.ojalgo.matrix.BasicMatrix....
java
chosen
[ { "from": "human", "value": "Test blur effect by texture resampling\n" }, { "from": "gpt", "value": "package com.haxademic.demo.draw.image;\n\nimport com.haxademic.core.app.P;\nimport com.haxademic.core.app.PAppletHax;\nimport com.haxademic.core.draw.image.ImageUtil;\nimport com.haxademic.core.f...
java
chosen
[ { "from": "human", "value": "Test send request without body.\n" }, { "from": "gpt", "value": "/**\n * Copyright (C) 2015 Deutsches Forschungszentrum für Künstliche Intelligenz (http://freme-project.eu)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use ...
java
chosen
[ { "from": "human", "value": "Add some very light contract-testing to FxmlLoader\n" }, { "from": "gpt", "value": "package moe.tristan.easyfxml.model.fxml;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\npublic class FxmlLoaderTes...
java
chosen
[ { "from": "human", "value": "Test that nocache is honored by CachedContentFetcher\n\n\ngit-svn-id: 3f2e04d30bd9db331bbfc569b45e7de8c0d84ef0@646542 13f79535-47bb-0310-9956-ffa450edef68\n" }, { "from": "gpt", "value": "/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more ...
java
chosen
[ { "from": "human", "value": "Add unit tests for com.site.lookup.util.StringUtils\n\nThese tests were written using Diffblue Cover.\n" }, { "from": "gpt", "value": "/*\n * Copyright (c) 2011-2019, Meituan Dianping. All Rights Reserved.\n *\n * Licensed to the Apache Software Foundation (ASF) unde...
java
chosen